From 6f6754fda1a75575ac37ee685f24d585369d9fde Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 14 Dec 2015 13:14:34 +0200 Subject: [PATCH] Check that the root pixmap exists before using it --- source/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); } -- 2.45.2