+ if (xr_screens > 0) {
+ /* Composite the unlock indicator in the middle of each screen. */
+ for (int screen = 0; screen < xr_screens; screen++) {
+ int x = (xr_resolutions[screen].x + ((xr_resolutions[screen].width / 2) - (BUTTON_DIAMETER / 2)));
+ int y = (xr_resolutions[screen].y + ((xr_resolutions[screen].height / 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);
+ }
+ } else {
+ /* 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);
+ cairo_set_source_surface(xcb_ctx, output, x, y);
+ cairo_rectangle(xcb_ctx, x, y, BUTTON_DIAMETER, BUTTON_DIAMETER);
+ cairo_fill(xcb_ctx);
+ }
+
+ cairo_surface_destroy(xcb_output);