screen: detect monitor configuration change

Xorg server from git[1] generates ConfigNotify event when monitor
configuration changes.

We handle the event, but only trigger required awesome_restart() if
screen size is changed. It's not what happens in case of monitor
configuration change.

Let's relax the condition and call awesome_restart() in response to all
ConfigNotify events to root window.

I'm not entirely sure that it wouldn't lead to superfluous restarts, but
I don't see an option.

[1] dbe8d03c42f0 ("randr: Send ConfigNotify when manual monitor list changes")

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
This commit is contained in:
Kirill A. Shutemov 2016-04-13 02:32:58 +03:00
parent c543f59696
commit 70d095df06
1 changed files with 1 additions and 3 deletions

View File

@ -399,9 +399,7 @@ event_handle_configurenotify(xcb_configure_notify_event_t *ev)
{ {
xcb_screen_t *screen = globalconf.screen; xcb_screen_t *screen = globalconf.screen;
if(ev->window == screen->root if(ev->window == screen->root)
&& (ev->width != screen->width_in_pixels
|| ev->height != screen->height_in_pixels))
/* it's not that we panic, but restart */ /* it's not that we panic, but restart */
awesome_restart(); awesome_restart();