]> git.sur5r.net Git - i3/i3lock/commitdiff
Bugfix: Correctly center unlock indicator after reconfiguring screens (Thanks xn)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 19 May 2012 19:13:03 +0000 (21:13 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 19 May 2012 19:13:03 +0000 (21:13 +0200)
Fixes: #712
i3lock.c
unlock_indicator.c

index 9c55db2bddd88e5468537aede07fe2c64ba4af61..7a2812d2ac0df971d7f248ac3bc81d949dd69d0d 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -431,6 +431,9 @@ void handle_screen_resize(void) {
     uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
     xcb_configure_window(conn, win, mask, last_resolution);
     xcb_flush(conn);
+
+    xinerama_query_screens();
+    redraw_screen();
 }
 
 /*
@@ -683,6 +686,8 @@ int main(int argc, char *argv[]) {
     last_resolution[0] = screen->width_in_pixels;
     last_resolution[1] = screen->height_in_pixels;
 
+    xcb_change_window_attributes(conn, screen->root, XCB_CW_EVENT_MASK,
+            (uint32_t[]){ XCB_EVENT_MASK_STRUCTURE_NOTIFY });
 
 #ifndef NOLIBCAIRO
     if (image_path) {
index 3a33ca95aff00dcb253f80a92c4cc146aef676d0..a0decb44657a6d7263f79df7c5638af0299075f9 100644 (file)
@@ -277,7 +277,7 @@ void redraw_screen(void) {
     xcb_change_window_attributes(conn, win, XCB_CW_BACK_PIXMAP, (uint32_t[1]){ bg_pixmap });
     /* XXX: Possible optimization: Only update the area in the middle of the
      * screen instead of the whole screen. */
-    xcb_clear_area(conn, 0, win, 0, 0, screen->width_in_pixels, screen->height_in_pixels);
+    xcb_clear_area(conn, 0, win, 0, 0, last_resolution[0], last_resolution[1]);
     xcb_free_pixmap(conn, bg_pixmap);
     xcb_flush(conn);
 }