here's the patch for EWMH support for scrotwm. Again, I'm really sorry
that it took this long. The patch is against the latest CVS version. Also,
the code should adhere to style(9) this time.
Like I promised, the patch implements (at least) the following:
- autoquirking using the _NET_WM_WINDOW_TYPE property (already present in
the previous patch)
- the _NET_ACTIVE_WINDOW property should work properly now
- fullscreen windows using the _NET_WM_STATE_FULLSCREEN property
- floaters remember floating state and position when restarting scrotwm
- implemented _NET_WM_STATE and _NET_WM_ALLOWED_ACTIONS.
There's one thing though. _NET_WM_ALLOWED_ACTIONS still allows only
floaters to be resized. This is because I couldn't think of a way to
implement the "resize the stack" in way that isn't surprinsing. For
example, when we have more than two columns (master and 1 other) in the
layout, I can't think of good way to react to a request for resizing a
window in the middle columns. I can implement it, but I need you to tell
me exactly how you want it to behave. :)
Do tell me if you find any bugs in the patch. All other feedback is
appreciated as well.
- Tuukka
From: Tuukka Kataja <stuge@xor.fi>
Thanks and some cleanup by me.
- A global last_focus_event helps us to determine whether another process
is playing with focus without telling us.
- merge focusin and focusout into a single focusevent, handle focus change
events triggered by synergy.
- Fix focus issues when entering a fullstack window from another region, by
checking to see which ws the focus is coming from before ignoring the
event.
ev->state indicates the state of the buttons and modifier keys, so it's not
just workspace changes but any time these buttons are down. This heuristic
breaks focus with mouse buttons down and when creating new terminals with
m-s-enter, among other things.
This mostly uses the same logic as a normal stack but it detects if the
previous window got unmapped and goes back to the parent. The rest is
the same code as stacked focusing.
Weed out VirtualNotify (switch ws and border crossings) and InferiorNotify
(focus on self, aka touching its own border).
Then check for ConfigureNotify to see if a window is being deleted or moved
to another work space.
This is the smaller hammer for the QLength trick that used to be in there.
If we still have focus issues we need to work those but this is worth
going in.
This win == win->ws->focus check makes scrotwm forget the correct
focus across workspace changes. Unnecessary focus changes are prevented
by the XGetInputFocus() check anyways.