]> git.sur5r.net Git - i3/i3lock/commitdiff
Fix centering the indicator in the no-xinerama case
authorSebastian Ullrich <sebasti@nullri.ch>
Thu, 28 Mar 2013 23:46:22 +0000 (00:46 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 29 Mar 2013 09:14:01 +0000 (10:14 +0100)
unlock_indicator.c

index ab4d56ed6f4e3cd47b895932d2293ec528a9b71c..5e4015c745f59887221b565f1ffff7617b593808 100644 (file)
@@ -246,8 +246,8 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
         /* We have no information about the screen sizes/positions, so we just
          * place the unlock indicator in the middle of the X root window and
          * hope for the best. */
-        int x = (last_resolution[0] / 2);
-        int y = (last_resolution[1] / 2);
+        int x = (last_resolution[0] / 2) - (BUTTON_DIAMETER / 2);
+        int y = (last_resolution[1] / 2) - (BUTTON_DIAMETER / 2);
         cairo_set_source_surface(xcb_ctx, output, x, y);
         cairo_rectangle(xcb_ctx, x, y, BUTTON_DIAMETER, BUTTON_DIAMETER);
         cairo_fill(xcb_ctx);