This has annoyed me for a long time...

1. have at least two windows
2. open the window menu with M-slash (alt+/)
3. show all windows with C-A (ctrl+a)
4. move cursor over list from top to bottom,
   observe no glitch
5. move cursor over list from bottom to top,
   observe "[" and "]" chars in entries being drawn over at the top,
   i.e. upper entries overlap lower ones

It's easy to miss but hard to unsee.

Today I looked and came up with the following fix, drawing menu entries
without overlap.

All these `height + 1' spread across seem off, but they seem consistent.

Okan, is there a better way to fix this?


This is trivial to reproduce wihout messing with your running X:

        $ Xephyr :1 &
        $ xterm -display 1 &
        $ xterm -display 1 &
        $ DISPLAY=:1 ./obj/cwm

Then click on the background/root window to navigate the window menu.


Index: app/cwm/menu.c
===================================================================
RCS file: /cvs/xenocara/app/cwm/menu.c,v
retrieving revision 1.109
diff -u -p -r1.109 menu.c
--- app/cwm/menu.c      27 Feb 2020 14:56:39 -0000      1.109
+++ app/cwm/menu.c      12 Oct 2022 21:24:17 -0000
@@ -436,7 +436,7 @@ menu_draw_entry(struct menu_ctx *mc, str
        color = (active) ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG;
        XftDrawRect(mc->xftdraw, &sc->xftcolor[color], 0,
            (sc->xftfont->height + 1) * entry, mc->geom.w,
-           (sc->xftfont->height + 1) + sc->xftfont->descent);
+           (sc->xftfont->height + 1) + sc->xftfont->descent - 1);
        color = (active) ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
        XftDrawStringUtf8(mc->xftdraw,
            &sc->xftcolor[color], sc->xftfont,

Reply via email to