Bugfix: Properly ignore UnmapNotify events (especially for floating windows)

This fixes the bug which caused floating windows to be visible even when
switching to a different workspace.

Instead of ignoring a specific sequence, we now set an ignore_unmap counter for
each container. (So, should containers be closed too early or stay open even if
they should be closed, we probably need to have a closer look at the counter.
At the moment, it is increased by one on reparenting and unmapping (for
workspace changes) and decremented by one on each UnmapNotify event).

This system is better because a sequence does not describe a single unmap or
reparent request but a request to X11 on the network layer -- which can contain
multiple requests.
This commit is contained in:
Michael Stapelberg
2010-11-20 19:11:43 +01:00
parent 131a2f8765
commit db651679c5
5 changed files with 106 additions and 8 deletions

View File

@ -338,6 +338,12 @@ struct Con {
FLOATING_USER_ON = 3
} floating;
/** This counter contains the number of UnmapNotify events for this
* container (or, more precisely, for its ->frame) which should be ignored.
* UnmapNotify events need to be ignored when they are caused by i3 itself,
* for example when reparenting or when unmapping the window on a workspace
* change. */
uint8_t ignore_unmap;
TAILQ_ENTRY(Con) nodes;
TAILQ_ENTRY(Con) focused;