We abuse (1 << 8) as mode_switch bit, which is in the range of the
filtered state bits (see previous commit). Therefore, we need to
filter first and then check for mode_switch.
Furthermore, we used 0x2 before, which was just wrong. So, use our
bitmask, not the normal one (0x2).
Sometimes, when the mouse button gets stuck, state contains the bit for
BUTTON_MASK_1 (or other buttons). We filter them out to continue processing
keys correctly.
Killing a dock client and having destroyed workspace 1 before (or the workspace
on which the dock client was started when it was not auto-started) crashed i3 before
this bugfix.
This is a relatively big change, however all cases should be handled by
now.
Because the function to do graphical resizing got rather large, I’ve created
a new file src/resize.c for it.
This fixes ticket #35.
However, it is a bit more flexible obviously. You can specify the
offset of the window you want to go to, to implement workflows like
the following:
* Jump to mutt
* Jump to irssi
* Jump back ("focus 2" would be the command)
Apparantly, under some conditions (using LANG=en_US.UTF-8, other locale
variables unset), asprintf() says "Invalid or incomplete multibyte or
wide character" when given a string in COMPOUND_TEXT encoding.
For now, we properly handle asprintf-errors (this should have been
before), but there might be a better solution.
This fixes ticket #24. The crash appeared only under special conditions:
- The screen on which you switch to must be empty or at least not as
full as the screen on which you were before.
- You switch focus using your mouse.
- You previously selected a column/row which is not availably on the
destination screen (for example (1,1) and switching to an empty
screen).
There was a race condition when mapping a window and not setting the event mask
before. Therefore, the ReparentNotify and (more important) the UnmapNotify generated
by reparenting were not received, thus leaving the awaiting_useless_unmap variable
of the client "true". To just make it work, in previous commits the DestroyNotify
handler was introduced. Fortunately, with fixing this race condition by first
setting the event mask and mapping the window afterwards, we can remove this handler.
As for the dock windows, there were quite some occurences were client->container
was used without checking if the client is inside a container at all.
Furthermore, the client’s strut containing the space to reserve at the screen edge
is now checked and the desired height is set to the window’s height if the strut
contains 0 or if no strut was specified at all.
By specifying XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, the window manager
will get map request events instead of map notify events, and therefore
can act sooner (the window won’t be positioned on the screen and moved
afterwards).
Furthermore, this fixes some problems with GIMP/VLC (and probably others)
which caused endless loops.
Also, events which should be ignored are now saved in a queue rather than
saving just the last event. This should eliminate race conditions.
Note that there is a new FIXME in src/handlers.c. Some windows generate
unmap notify events when reparenting while others don’t. We need to
understand, document and implement a more correct way to handle this.