From 93463bc3932e820bc86383fc4de1a07c82356967 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 30 Aug 2013 19:59:57 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix:=20update=20root=20geometry=20on=20outpu?= =?UTF-8?q?t=20changes=20for=20=E2=80=9Cfullscreen=20global=E2=80=9D=20(Th?= =?UTF-8?q?anks=20kaersten)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #1064 --- src/handlers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/handlers.c b/src/handlers.c index 36c83399..931e8634 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -423,6 +423,19 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n static void handle_screen_change(xcb_generic_event_t *e) { DLOG("RandR screen change\n"); + /* The geometry of the root window is used for “fullscreen global” and + * changes when new outputs are added. */ + xcb_get_geometry_cookie_t cookie = xcb_get_geometry(conn, root); + xcb_get_geometry_reply_t *reply = xcb_get_geometry_reply(conn, cookie, NULL); + if (reply == NULL) { + ELOG("Could not get geometry of the root window, exiting\n"); + exit(1); + } + DLOG("root geometry reply: (%d, %d) %d x %d\n", reply->x, reply->y, reply->width, reply->height); + + croot->rect.width = reply->width; + croot->rect.height = reply->height; + randr_query_outputs(); scratchpad_fix_resolution();