]> Pileus Git - wmpus/commitdiff
Query root window geometry
authorAndy Spencer <andy753421@gmail.com>
Fri, 10 Apr 2015 05:10:19 +0000 (05:10 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 15 Apr 2015 19:54:07 +0000 (19:54 +0000)
sys-xcb.c

index 3dba29fc10d4ee7b9417d812d2083643b412391b..26a105f059cbdb2550fe8563b52cab5f702b58db 100644 (file)
--- a/sys-xcb.c
+++ b/sys-xcb.c
@@ -295,12 +295,19 @@ list_t *sys_info(void)
        printf("sys_info\n");
 
        if (screens == NULL) {
+               /* No xinerama support */
+               const xcb_setup_t *setup = xcb_get_setup(conn);
+               xcb_screen_t      *geom  = xcb_setup_roots_iterator(setup).data;
+
                win_t *screen = new0(win_t);
-               screen->x = 0;
-               screen->y = 0;
-               screen->w = 800;
-               screen->h = 600;
+
+               screen->w = geom->width_in_pixels;
+               screen->h = geom->height_in_pixels;
+
                screens = list_insert(NULL, screen);
+
+               printf("sys_info: root screen - %dx%d\n",
+                               screen->w, screen->h);
        }
 
        return screens;