From: Mikko Rasa Date: Mon, 14 Dec 2015 11:14:34 +0000 (+0200) Subject: Check that the root pixmap exists before using it X-Git-Url: http://git.tdb.fi/?p=geometrycompositor.git;a=commitdiff_plain;h=6f6754fda1a75575ac37ee685f24d585369d9fde Check that the root pixmap exists before using it --- diff --git a/source/main.c b/source/main.c index 2a22fdf..23c061b 100644 --- a/source/main.c +++ b/source/main.c @@ -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); }