read the _NET_WM_WINDOW_OPACITY property that transset sets, and use it when determin...
[dana/dcompmgr.git] / dcompmgr.c
index b3619ba..f6b7019 100644 (file)
@@ -181,16 +181,34 @@ event(d_display_t *dpy)
         case XCB_PROPERTY_NOTIFY:
         {
             xcb_property_notify_event_t *pev;
-            d_screen_t *sc;
 
             pev = (xcb_property_notify_event_t*)ev;
-            sc = display_screen_from_root(dpy, pev->window);
-            if (!sc) break;
             if (pev->atom == dpy->a.xrootpmap_id ||
                 pev->atom == dpy->a.esetroot_pmap_id ||
                 pev->atom == dpy->a.xsetroot_id)
             {
-                sc->screen_root_pixmap_change(sc);
+                d_screen_t *sc;
+
+                sc = display_screen_from_root(dpy, pev->window);
+                if (sc) sc->screen_root_pixmap_change(sc);
+            }
+            else if (pev->atom == dpy->a.net_wm_window_opacity) {
+                d_list_it_t *it;
+
+                for (it = list_top(dpy->screens); it; it = it->next) {
+                    d_screen_t *sc = it->data;
+                    d_window_t *w;
+
+                    w = screen_find_window(sc, pev->window);
+                    if (w) {
+                        window_update_user_opacity(w);
+                        if (window_is_mapped(w)) {
+                            sc->window_opacity_change(w);
+                            screen_refresh(w->sc);
+                        }
+                    }
+                }
+                    
             }
             break;
         }