fix cases of getting confused if something is mapped or not. only use the mapped...
authorDana Jansens <danakj@orodu.net>
Wed, 5 Mar 2008 15:13:34 +0000 (10:13 -0500)
committerDana Jansens <danakj@orodu.net>
Wed, 5 Mar 2008 15:13:34 +0000 (10:13 -0500)
dcompmgr.c
window.c
window.h

index c878649..0957069 100644 (file)
@@ -350,12 +350,8 @@ main(int argc, char **argv)
             d_screen_t *sc = sc_it->data;
             d_list_it_t *it;
             for (it = list_bottom(sc->stacking); it; it = it->prev)
             d_screen_t *sc = sc_it->data;
             d_list_it_t *it;
             for (it = list_bottom(sc->stacking); it; it = it->prev)
-                if (window_is_mapped(it->data)) {
-                    /* make the window think it is unmapped so that the
-                       show works right */
-                    window_fake_unmapped(it->data);
+                if (window_is_attr_mapped(it->data))
                     sc->window_show(it->data);
                     sc->window_show(it->data);
-                }
         }
     }
 
         }
     }
 
index 2c55b10..138c1fe 100644 (file)
--- a/window.c
+++ b/window.c
@@ -21,13 +21,14 @@ typedef struct {
 
     /* queried things, don't read them directly from the struct */
     int              x, y, w, h, bw;
 
     /* queried things, don't read them directly from the struct */
     int              x, y, w, h, bw;
-    gboolean         mapped;
+    gboolean         attr_mapped;
     gboolean         input_only;
     xcb_visualid_t   visual;
     xcb_pixmap_t     pixmap;
 
     double           opacity;
 
     gboolean         input_only;
     xcb_visualid_t   visual;
     xcb_pixmap_t     pixmap;
 
     double           opacity;
 
+    gboolean         mapped;
     gboolean         zombie;
 
     d_list_t        *plugin_data;
     gboolean         zombie;
 
     d_list_t        *plugin_data;
@@ -55,6 +56,7 @@ window_new(xcb_window_t id, struct d_screen *sc)
     w->ref = 1;
     w->sc = sc;
     w->zombie = FALSE;
     w->ref = 1;
     w->sc = sc;
     w->zombie = FALSE;
+    w->mapped = FALSE;
     w->pixmap = XCB_NONE;
     w->damage = XCB_NONE;
 
     w->pixmap = XCB_NONE;
     w->damage = XCB_NONE;
 
@@ -131,7 +133,6 @@ window_show(d_window_t *pubw)
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
 
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
 
-    window_is_mapped(pubw); /* kill any ongoing request */
     assert(!w->mapped);
 
     //printf("show window 0x%x\n", w->id);
     assert(!w->mapped);
 
     //printf("show window 0x%x\n", w->id);
@@ -145,7 +146,6 @@ window_hide(d_window_t *pubw)
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
 
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
 
-    window_is_mapped(pubw); /* kill any ongoing request */
     assert(w->mapped);
 
     //printf("hide window 0x%x\n", w->id);
     assert(w->mapped);
 
     //printf("hide window 0x%x\n", w->id);
@@ -213,14 +213,14 @@ window_get_attributes_reply(d_window_priv_t *w)
 
     if (rep) {
         w->input_only = rep->_class == XCB_WINDOW_CLASS_INPUT_ONLY;
 
     if (rep) {
         w->input_only = rep->_class == XCB_WINDOW_CLASS_INPUT_ONLY;
-        w->mapped = rep->map_state != XCB_MAP_STATE_UNMAPPED;
+        w->attr_mapped = rep->map_state != XCB_MAP_STATE_UNMAPPED;
         w->visual = rep->visual;
         //printf("0x%x attributes mapped %d\n", w->id, w->mapped);
         free(rep);
     }
     else {
         w->input_only = TRUE;
         w->visual = rep->visual;
         //printf("0x%x attributes mapped %d\n", w->id, w->mapped);
         free(rep);
     }
     else {
         w->input_only = TRUE;
-        w->mapped = FALSE;
+        w->attr_mapped = FALSE;
         w->visual = XCB_NONE;
     }
     if (err) {
         w->visual = XCB_NONE;
     }
     if (err) {
@@ -264,9 +264,16 @@ gboolean
 window_is_mapped(d_window_t *pubw)
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
 window_is_mapped(d_window_t *pubw)
 {
     d_window_priv_t *w = (d_window_priv_t*)pubw;
+    return w->mapped;
+}
+
+gboolean
+window_is_attr_mapped(d_window_t *pubw)
+{
+    d_window_priv_t *w = (d_window_priv_t*)pubw;
     if (w->waiting_attr)
         window_get_attributes_reply(w);
     if (w->waiting_attr)
         window_get_attributes_reply(w);
-    return w->mapped;
+    return w->attr_mapped;
 }
 
 xcb_pixmap_t
 }
 
 xcb_pixmap_t
index 59a8749..7e6784a 100644 (file)
--- a/window.h
+++ b/window.h
@@ -30,6 +30,7 @@ void window_resize(d_window_t *w);
 gboolean window_is_zombie(d_window_t *w);
 gboolean window_is_input_only(d_window_t *w);
 gboolean window_is_mapped(d_window_t *w);
 gboolean window_is_zombie(d_window_t *w);
 gboolean window_is_input_only(d_window_t *w);
 gboolean window_is_mapped(d_window_t *w);
+gboolean window_is_attr_mapped(d_window_t *w);
 
 void window_get_area(d_window_t *pubw, int *x, int *y, int *width, int *height,
                      int *border_width);
 
 void window_get_area(d_window_t *pubw, int *x, int *y, int *width, int *height,
                      int *border_width);