awesome/objects
Uli Schlachter f290ea8b12 Stop grabbing mouse buttons on frame windows (#1724)
I failed to see the obvious. Thanks to mlen from IRC to make
me look into i3's source code so that I can figure out the obvious.

First, what is the problem? We want to be informed about mouse clicks on
client windows, e.g. for client-to-focus. For this we have to grab mouse
buttons on the client window, since only a single client at a time can
ask for information about all mouse clicks (I think...) and that right
is reserved for the actual application and not the WM.

We also want to be informed about mouse clicks on the titlebar, so that
clicking there actually does something (and also e.g. click-to-focus).
Obviously, we can just grab mouse buttons on the titlebar as well.

However, this causes lots of problems. The X11 window containing the
titlebar is not just the size of the titlebar, but also includes all of
the actual client window. This means that clicking into the client also
activates our button grab on the titlebar. This, in turn, causes the
input focus to briefly shift to the window for the titlebar. This shift
of focus can be detected by clients and caused various issues.

This fix is so obvious that I missed it. We don't have to grab buttons
on the titlebar window. We can just use the "normal" event propagation
without grabs there, i.e. we just include the event masks for button
press and button release and get informed about all mouse events. In
fact, we already have this event mask in place, so the whole use of
grabs is redundant.

That's what this commit does. It also partially reverts commit
394ff06589 which is where this unnecessary grabbing was introduced.

Fixes: https://github.com/awesomeWM/awesome/issues/1479
Fixes: https://github.com/awesomeWM/awesome/issues/1658
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-18 14:39:43 +02:00
..
button.c Remove @release @AWESOME_VERSION@ everywhere (#1157) 2016-10-09 22:36:20 +02:00
button.h Clean up header includes 2014-03-30 20:07:48 +02:00
client.c pull #1648: add icon_sizes property signal emission 2017-03-14 19:38:25 +01:00
client.h C code: save all instead of just one client icons 2017-03-07 22:45:49 +01:00
drawable.c Remove @release @AWESOME_VERSION@ everywhere (#1157) 2016-10-09 22:36:20 +02:00
drawable.h drawable/drawin: Pass both lua_State and stack index around 2014-12-06 10:46:45 +01:00
drawin.c Partly fix removal of systray from a wibox 2017-03-11 18:14:38 +01:00
drawin.h Partly fix removal of systray from a wibox 2017-03-11 18:14:38 +01:00
key.c Remove obsolete include and Xlib comment. 2017-01-05 23:17:11 +01:00
key.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
screen.c screen.c: Always emit "primary_changed" when needed 2017-03-03 13:25:28 +01:00
screen.h Fix a bug moving between a tiled and a floating screen. 2016-09-02 20:15:00 +01:00
tag.c doc: mention to select a tag on awful.tag.add (#1520) 2017-02-04 15:13:12 +01:00
tag.h Attempt at better handling of NET_CURRENT_DESKTOP property. 2016-06-04 16:42:54 +03:00
window.c Stop grabbing mouse buttons on frame windows (#1724) 2017-04-18 14:39:43 +02:00
window.h geometry: Use the relevant rounding functions instead of integers 2016-04-18 04:20:22 -04:00