the code is more or less there. have to figure out how to find the fbconfigs right...
[dana/dcompmgr.git] / window.c
index 39685a8..b14de39 100644 (file)
--- a/window.c
+++ b/window.c
@@ -26,7 +26,7 @@ typedef struct {
     int                 x, y, w, h, bw;
     gboolean            attr_mapped;
     gboolean            input_only;
-    gboolean            argb;
+    uint8_t             depth;
     xcb_visualid_t      visual;
     xcb_pixmap_t        pixmap;
     xcb_xfixes_region_t region;
@@ -338,14 +338,14 @@ window_get_geometry_reply(d_window_priv_t *w)
         w->w = rep->width;
         w->h = rep->height;
         w->bw = rep->border_width;
-        w->argb = rep->depth == 32;
+        w->depth = rep->depth;
         free(rep);
     }
     else {
         w->x = w->y = -1;
         w->w = w->h = 1;
         w->bw = 0;
-        w->argb = FALSE;
+        w->depth = 0;
     }
     if (err) {
         printf("error getting geometry for window 0x%x\n", w->id);
@@ -373,10 +373,17 @@ window_is_attr_mapped(d_window_t *pubw)
 gboolean
 window_is_argb(d_window_t *pubw)
 {
+    uint8_t depth = window_get_depth(pubw);
+    return depth == 32;
+}
+
+uint8_t
+window_get_depth(d_window_t *pubw)
+{
     d_window_priv_t *w = (d_window_priv_t*)pubw;
     if (w->waiting_geom)
         window_get_geometry_reply(w);
-    return w->argb;
+    return w->depth;
 }
 
 xcb_visualid_t