]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Check that the root pixmap exists before using it
authorMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 11:14:34 +0000 (13:14 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 11:14:34 +0000 (13:14 +0200)
source/main.c

index 2a22fdffd939619d73c81965708cf095eba845d2..23c061b86fc3a5557dfba3b2266499f29b36ef1c 100644 (file)
@@ -815,6 +815,12 @@ void update_root_pixmap(Compositor *compositor, CompositedScreen *screen)
        unsigned long overflow;
        unsigned long length;
        long *pixmap;
+       Window root;
+       int x, y;
+       unsigned width;
+       unsigned height;
+       unsigned border;
+       unsigned depth;
 
        use_gl(compositor, screen);
 
@@ -833,7 +839,10 @@ void update_root_pixmap(Compositor *compositor, CompositedScreen *screen)
        }
 
        screen->root_pixmap = pixmap[0];
-       screen->root_glx_pixmap = pixmap_to_glx_pixmap(compositor, screen, screen->root_pixmap);
+       if(XGetGeometry(compositor->display, screen->root_pixmap, &root, &x, &y, &width, &height, &border, &depth))
+               screen->root_glx_pixmap = pixmap_to_glx_pixmap(compositor, screen, screen->root_pixmap);
+       else
+               screen->root_pixmap = None;
 
        XFree(pixmap);
 }