diff options
unmanage: stop listening for events for unmanaged windows
This is in particular to avoid flickering in dwm (and high CPU usage)
when hovering the mouse over a tabbed window that was previously
managed by dwm.
Consider the following two scenarios:
1)
We start tabbed (window 0xc000003), tabbed is managed by the
window manager.
We start st being embedded into tabbed.
$ st -w 0xc000003
What happens here is that:
- tabbed gets a MapRequest for the st window
- tabbed reparents the st window
- tabbed will receive X events for the window
The window manager will have no awareness of the st window and the
X server will not send X events to the window manager relating to
the st window.
There is no flickering or any other issues relating to focus.
2)
We start tabbed (window 0xc000003), tabbed is managed by the
window manager.
We start st as normal (window 0xd400005).
What happens here is that:
- the window manager gets a MapRequest for the st window
- dwm manages the st window as a normal client
- dwm will receive X events for the window
Now we use xdotool to trigger a reparenting of the st window into
tabbed.
$ xdotool windowreparent 0xd400005 0xc000003
What happens here is that:
- tabbed gets a MapRequest for the st window
- tabbed reparents the st window
- the window manager gets an UnmapNotify
- the window manager no longer manages the st window
- both the window manager and tabbed will receive X events
for the st window
In dwm move the mouse cursor over the tabbed window.
What happens now is that:
- dwm will receive a FocusIn event for the tabbed window
- dwm will set input focus for the tabbed window
- tabbed will receive a FocusIn event for the main window
- tabbed will give focus to the window on the currently selected
tab
- which again triggers a FocusIn event which dwm receives
- dwm determines that the window that the FocusIn event is for
(0xd400005) is not the currently selected client (tabbed)
- dwm sets input focus for the tabbed window
- this causes an infinite loop as long as the mouse cursor hovers
the tabbed window, resulting in flickering and high CPU usage
The fix here is to tell the X server that we are no longer interested
in receiving events for this window when the window manager stops
managing the window.
Diffstat (limited to '%252525252525252525252525252525253fid%252525252525252525252525252525253deb1619b7f22da24f6b5c5f6806428fda67214bb8%2525252525252525252525252525253fid%2525252525252525252525252525253deb1619b7f22da24f6b5c5f6806428fda67214bb8%25252525252525252525252525253fid%25252525252525252525252525253deb1619b7f22da24f6b5c5f6806428fda67214bb8%252525252525252525252525253fid%252525252525252525252525253d2e5612566918898a7edf5b526162e644863f30d0%2525252525252525252525253fid%2525252525252525252525253d04c2d3bf025044724b4d06d782067fd58d36b498%25252525252525252525253fid%25252525252525252525253d04c2d3bf025044724b4d06d782067fd58d36b498%252525252525252525253fid%252525252525252525253d00cfdc0aa7a75aae42303cebda46ffaa95803b27%2525252525252525253fid%2525252525252525253d6d6e0ea56f6784dd35173eff2d17c259b1588d0e%25252525252525253fid%25252525252525253d6d6e0ea56f6784dd35173eff2d17c259b1588d0e%252525252525253fid%252525252525253da859676ead17017bbe81b4989b2f2e0b00a0b4ba%2525252525253fid%2525252525253da859676ead17017bbe81b4989b2f2e0b00a0b4ba%25252525253fid%25252525253da859676ead17017bbe81b4989b2f2e0b00a0b4ba%252525253fid%252525253de0dee911455cee739a5b05a994828f4a37a2764d%2525253fid%2525253d5e76e7e21da042c493c59235ca82d7275f20a7e4%25253fid%25253d5b2e5e7a4001479e4dc3e245f96e49f7ea0da658%253fid%253d5b2e5e7a4001479e4dc3e245f96e49f7ea0da658%3fid%3d5b2e5e7a4001479e4dc3e245f96e49f7ea0da658?id=786f6e2a6f8466ad94706781bc93bc6eb6e69512')
0 files changed, 0 insertions, 0 deletions