From 70d095df06a613cbc6559cd6800f95daf0d52f04 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 13 Apr 2016 02:32:58 +0300 Subject: [PATCH] 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 --- event.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/event.c b/event.c index 83d388d2..3062c5ce 100644 --- a/event.c +++ b/event.c @@ -399,9 +399,7 @@ event_handle_configurenotify(xcb_configure_notify_event_t *ev) { xcb_screen_t *screen = globalconf.screen; - if(ev->window == screen->root - && (ev->width != screen->width_in_pixels - || ev->height != screen->height_in_pixels)) + if(ev->window == screen->root) /* it's not that we panic, but restart */ awesome_restart();