initialize gl on the overlay window
[dana/dcompmgr.git] / screen.c
index 8314c00..3048703 100644 (file)
--- a/screen.c
+++ b/screen.c
@@ -185,6 +185,8 @@ screen_init(d_screen_t *sc)
     /* make the overlay window click-through */
     if (sc->overlay) {
         xcb_xfixes_region_t region;
+        xcb_get_window_attributes_cookie_t attr_ck;
+        xcb_get_window_attributes_reply_t *attr_rep;
 
         region = xcb_generate_id(sc->dpy->conn);
         xcb_xfixes_create_region(sc->dpy->conn, region, 0, NULL);
@@ -197,7 +199,17 @@ screen_init(d_screen_t *sc)
                                            XCB_SHAPE_SK_INPUT,
                                            0, 0, region);
         xcb_xfixes_destroy_region(sc->dpy->conn, region);
+
+        attr_ck = xcb_get_window_attributes(sc->dpy->conn, sc->overlay);
+        attr_rep = xcb_get_window_attributes_reply(sc->dpy->conn, attr_ck,
+                                                   NULL);
+        if (!attr_rep)
+            return FALSE;
+        sc->overlay_visual = attr_rep->visual;
+        free(attr_rep);
     }
+    else
+        return FALSE;
 #endif
 
     mask = SELECTION_MASK;