From 74572308adfaf62f0669df4e2369e1b31203042d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 14 Dec 2015 03:14:57 +0200 Subject: [PATCH] Monitor changes to the root window pixmap --- source/main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/source/main.c b/source/main.c index 36e8d28..a1d0f1c 100644 --- a/source/main.c +++ b/source/main.c @@ -816,16 +816,19 @@ void update_root_pixmap(Compositor *compositor, CompositedScreen *screen) unsigned long length; long *pixmap; + use_gl(compositor, screen); + + if(screen->root_glx_pixmap) + { + glXDestroyPixmap(compositor->display, screen->root_glx_pixmap); + screen->root_glx_pixmap = 0; + } + XGetWindowProperty(compositor->display, screen->root, compositor->root_pmap_atom, 0, 1, False, XA_PIXMAP, &prop_type, &prop_format, &length, &overflow, (unsigned char **)&pixmap); if(prop_type!=XA_PIXMAP || prop_format!=32) { screen->root_pixmap = 0; - if(screen->root_glx_pixmap) - { - glXDestroyPixmap(compositor->display, screen->root_glx_pixmap); - screen->root_glx_pixmap = 0; - } return; } @@ -1149,14 +1152,14 @@ void process_property_event(Compositor *compositor, XPropertyEvent *event) { CompositedScreen *screen; - if(event->atom!=compositor->correction_atom) - return; - screen = find_screen_by_root(compositor, event->window); if(!screen) return; - update_geometry_correction(compositor, screen); + if(event->atom==compositor->correction_atom) + update_geometry_correction(compositor, screen); + else if(event->atom==compositor->root_pmap_atom) + update_root_pixmap(compositor, screen); } void process_damage_event(Compositor *compositor, XDamageNotifyEvent *event) -- 2.43.0