First of all, thank you for your work on cortile! This is an excellent addition to classic WMs like Openbox and Xfwm.
Unfortunately, I'm experiencing frequent hiccups on my setup that can mostly be attributed to cortile not receiving all events from the X connection occasionally. I'm running LXQt with Openbox on NixOS using a multi-monitor setup with 2 monitors.
The issue happens when switching workspaces via Openbox's keybindings. Sometimes (roughly every 5~10 switches), cortile does not register the workspace change. This leads to all kinds of glitches because cortile doesn't update its internal state properly, so cycling the tiling mode applies to the wrong workspace, windows not snapping back into position etc.
While trying to identify the problem I added more log output to cortile at places where X events are initially received and processed. I noticed that occasionally some events are never received by cortile at all, for example the _NET_CURRENT_DESKTOP
property change from the root window when changing the workspace.
At first I thought it was about my picom config and all the stuff going on (fade animation, blur) that choked the X connection and event queue somehow but then I noticed it doesn't happen when changing the workspace via external means (wmctrl
or the workspace switcher of the LXQt panel) instead of Openbox's keybindings. See the reproduction steps below.
For the time being I can resort to wmctrl
and other external means for workspace switching but it would be great to get to the bottom of this and fully support Openbox's native behavior.
Unfortunately, I have no clue yet why this is happening at all. Since the workspace indicator of LXQt's panel keeps updating correctly everytime (it also listens to the same X events afaik) it does not seem like the X events are not emitted in general, just that cortile doesn't receive them occasionally when they originate from Openbox keybinding actions.
How to reproduce
Consider the following Openbox keybindings:
<keybind key="A-1">
<action name="GoToDesktop">
<to>1</to>
</action>
</keybind>
<keybind key="A-2">
<action name="GoToDesktop">
<to>2</to>
</action>
</keybind>
<keybind key="A-Escape">
<action name="GoToDesktop">
<to>last</to>
</action>
</keybind>
To reproduce:
- Switch to the second workspace and change the tiling layout in cortile so that the tray icon displays a different layout than on workspace 1.
- Continuously switch between workspace 1 and 2 by either alternating between Alt+1 and Alt+2 keypresses or repeatedly press Alt+Escape to switch back and forth.
Eventually, cortile will miss events which is visible by the tray icon not updating the layout indicator after changing the workspace. For example, if workspace 2 was set to maximized and the keypress switched to workspace 1, the icon will keep displaying the maximized layout.
Now in contrast, binding Alt+1 and Alt+2 outside of Openbox (e.g. via LXQt's hotkey handler) to wmctrl -s 0
and wmctrl -s 1
respectively or using the scroll wheel on the workspace indicator of the LXQt panel to continuously switch workspaces back and forth does not seem to trigger the issue at all.