Correctly handle focus across restarts (FS#1055)
commit0b6b3bb458e491adf0a5b1bcf31449a41ba3b842
authorUli Schlachter <psychon@znc.in>
Thu, 13 Dec 2012 19:31:18 +0000 (13 20:31 +0100)
committerUli Schlachter <psychon@znc.in>
Thu, 13 Dec 2012 19:31:18 +0000 (13 20:31 +0100)
treef056db7199adc40858d784e07d527ee9f0de144c
parent6db7bdfcb960a154473416fff53e0f9b28488b49
Correctly handle focus across restarts (FS#1055)

X11 is a great protocol. When a window manager dies, it can make sure that
client windows don't get destroyed via the save-set. However, revert-to-parent
focus handling means that the focus now shifts to the parent which gets
destroyed and afterwards the focus is "none", which is a really bad state.

Fix this in two places:

First, when shutting down, we switch to PointerRoot mode. This makes sure that
the input focus follows the mouse pointer if no window manager is started.

Also make sure that we set the input focus the way we want it to be after start
up. This obviously cleans up any weird state which might exist before we manage
the input focus.

Signed-off-by: Uli Schlachter <psychon@znc.in>
awesome.c