#include <strings.h> /* explicit_bzero(3) */
#endif
#include <xcb/xcb_aux.h>
+#include <xcb/randr.h>
#include "i3lock.h"
#include "xcb.h"
static struct xkb_compose_state *xkb_compose_state;
static uint8_t xkb_base_event;
static uint8_t xkb_base_error;
+static int randr_base = -1;
cairo_surface_t *img = NULL;
bool tile = false;
xcb_configure_window(conn, win, mask, last_resolution);
xcb_flush(conn);
- xinerama_query_screens();
+ randr_query(screen->root);
redraw_screen();
}
break;
default:
- if (type == xkb_base_event)
+ if (type == xkb_base_event) {
process_xkb_event(event);
+ }
+ if (randr_base > -1 &&
+ type == randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY) {
+ randr_query(screen->root);
+ handle_screen_resize();
+ }
}
free(event);
load_compose_table(locale);
- xinerama_init();
- xinerama_query_screens();
-
screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;
+ randr_init(&randr_base, screen->root);
+ randr_query(screen->root);
+
last_resolution[0] = screen->width_in_pixels;
last_resolution[1] = screen->height_in_pixels;