From f8c835a33a7acd6f60e27f82ac40027d3ae15e25 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Fri, 14 May 2021 21:47:41 +0100 Subject: Fix delayed reaction to USR1/2 signals While using xmobar to reproduce/fix a bug in xmonad I noticed that xmobar doesn't react immediately to the signals to reposition or change screen. Apparently none of the Xlib functions called from `repositionWin` flush the Xlib output buffer (XMoveResizeWindow is known to not flush, although it's unfortunately not documented), so when compiled with the threaded runtime that runs XNextEvent in a separate thread, the reposition is sent to the X server only later when other stuff happens. With all monitors set to refresh once a minute, this can take a looong time. (It's entirely possible this happens even without the threaded runtime, I didn't test that, sorry.) The fix is to call XSync at the end of `repositionWin`. While at it, I spotted that drawInWin calls XSync with discard=true, which seems like a mistake. We don't want to discard any events, do we? (In practice, I'd expect the `eventer` thread to read all events even before the drawing thread manages to discard them, so even if this discarding XSync ever had any reason to be there, I don't think it does anything meaningful these days. I may be wrong, though.) --- changelog.md | 1 + 1 file changed, 1 insertion(+) (limited to 'changelog.md') diff --git a/changelog.md b/changelog.md index 072932e..0f24ebf 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ _Bug fixes_ - Revert the double-UTF-8 encoding workarounds of 0.36 (#482), as they're no longer necessary with xmonad-contrib master, and aren't needed with any released version of xmonad-contrib either. + - Fix slow reactions to SIGUSR1/2 signals (reposition, change screen). ## Version 0.37 (November, 2020) -- cgit v1.2.3