[dev] [dmenu] Unintentional fallthrough in xft-patch

From: Hans-Peter Deifel <hpdeifel_AT_gmx.de>
Date: Wed, 22 Jan 2014 17:18:15 +0100

Hi,

The patch on [1] introduces an unintentional fallthrough in a
case-statement. Here is the relevant part of the patch:

_AT_@ -359,7 +376,8 @@ keypress(XKeyEvent *ev) {
         case XK_Return:
         case XK_KP_Enter:
                 puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
- exit(EXIT_SUCCESS);
+ ret = EXIT_SUCCESS;
+ running = False;
         case XK_Right:


You can see that the exit is replaced by two lines but no break.

This means that everytime the user selects an entry, instead of exiting
right away, dmenu selects the next entry (behaviour of XK_Right),
redraws and exits immediately afterwards. Normally, one wouldn't notice
the last redraw because the time is too short, but compositing managers
such as compton have a fade-out effect that takes the last image of a
closed window and fade it out slowly. Which means that you get to see
the wrongly selected entry.

Attached is a patch that fixes the problem and can be applied on top of
the xft-patch itself. I also attach a new xft-patch that includes my
changes for your convenience.

Please note that I haven't ported the xft-patch to git-dmenu, yet. So
like the original patch under [1], both are only meant for 4.5.

There is also a gentoo bug about this isssue: [2]

Regards,
HP

[1] http://tools.suckless.org/dmenu/patches/xft
[2] https://bugs.gentoo.org/show_bug.cgi?id=498924


Received on Wed Jan 22 2014 - 17:18:15 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 22 2014 - 17:48:06 CET