Conky desktop widgets swallow/misroute clicks — root cause found + fix ready

Been chasing down A flaky click-through issue with the latest stock conky.

Desktop widgets (right/left-click sometimes not reaching the desktop context menu, fixed by openbox --restart).

Traced it all the way to conky’s C++ source and found the actual cause.

What’s actually happening

All our conky widgets use the same setup:

own_window = true,
own_window_type = 'desktop',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',

This is supposed to make the widget fully click-through at the X11 level (conky sets an empty “input shape” on the window for exactly this case).

But conky 1.24.x still unconditionally subscribes to mouse button events on that window regardless of window type, even though nothing in our configs uses conky’s interactive lua_mouse_hook feature.

So every click gets intercepted by conky first, which then tries to manually re-forward it to whatever’s underneath.

For the time being a patched conky.

git clone https://github.com/musqz/conky-patch-mabox.git
cd conky-patch-mabox
sudo pacman -U conky-1.24.2-1-x86_64.pkg.tar.zst 

For the interest: Diff

TY fren 123

Is the real patch available somewhere?
This file from gist looks to me the same as conky-use-system-cmake.patch from official Arch Linux package…

My mistake :robot:

This should be the right diff.

diff --git a/src/output/x11.cc b/src/output/x11.cc
index 9801ab28..372d8798 100644
--- a/src/output/x11.cc
+++ b/src/output/x11.cc
@@ -883,8 +883,15 @@ void x11_init_window(lua::state &l, bool own) {

     if (own) {
       selected_events.clear_all();
-      selected_events.set(XI_ButtonPress);
-      selected_events.set(XI_ButtonRelease);
+      // Desktop windows rely on an empty XShape input region for
+      // click-through; only grab buttons if a mouse hook actually wants them.
+      bool wants_button_events =
+          own_window_type.get(l) != window_type::DESKTOP ||
+          !conky::lua_mouse_hook.get(l).empty();
+      if (wants_button_events) {
+        selected_events.set(XI_ButtonPress);
+        selected_events.set(XI_ButtonRelease);
+      }
       // It's not recommended to add event masks to special windows in X; causes
       // a crash (thus own_window_type != window_type::DESKTOP)
       if (own_window_type.get(l) != window_type::DESKTOP) {

Thanks a lot @muzqs :slight_smile:
I will try to build patched version and push to repo.