Save ConfigureNotify events for unmapped windows until the window maps. If a window... fixobiconfify
authorDana Jansens <danakj@orodu.net>
Fri, 15 Feb 2008 05:55:17 +0000 (00:55 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 15 Feb 2008 05:55:17 +0000 (00:55 -0500)
xcompmgr.c

index baf68cf4fae8633ed5bd744345d39c0ff2348abf..f4dd9e473114ef9671aebba371bf4cfa93313a89 100644 (file)
@@ -101,6 +101,9 @@ typedef struct _win {
     wintype             windowType;
     unsigned long      damage_sequence;    /* sequence when damage was created */
 
+    Bool                need_configure;
+    XConfigureEvent     queue_configure;
+
     /* for drawing translucent windows */
     XserverRegion      borderClip;
     struct _win                *prev_trans;
@@ -1276,6 +1279,9 @@ determine_wintype (Display *dpy, Window w, Window top)
 static unsigned int
 get_opacity_prop (Display *dpy, win *w, unsigned int def);
 
+static void
+configure_win (Display *dpy, XConfigureEvent *ce);
+
 static void
 map_win (Display *dpy, Window id, unsigned long sequence, Bool fade)
 {
@@ -1285,7 +1291,7 @@ map_win (Display *dpy, Window id, unsigned long sequence, Bool fade)
        return;
 
     w->a.map_state = IsViewable;
-    
+
     /* This needs to be here or else we lose transparency messages */
     XSelectInput (dpy, id, PropertyChangeMask);
 
@@ -1304,6 +1310,11 @@ map_win (Display *dpy, Window id, unsigned long sequence, Bool fade)
 #endif
     w->damaged = 0;
 
+    if (w->need_configure) {
+        w->need_configure = False;
+        configure_win (dpy, &w->queue_configure);
+    }
+
     if (fade && winTypeFade[w->windowType])
        set_fade (dpy, w, 0, get_opacity_percent (dpy, w), fade_in_step, 0, True, True);
 }
@@ -1522,6 +1533,7 @@ add_win (Display *dpy, Window id, Window prev)
     new->shadow_width = 0;
     new->shadow_height = 0;
     new->opacity = OPAQUE;
+    new->need_configure = False;
 
     new->borderClip = None;
     new->prev_trans = 0;
@@ -1582,6 +1594,14 @@ configure_win (Display *dpy, XConfigureEvent *ce)
        }
        return;
     }
+
+    if (w->a.map_state == IsUnmapped) {
+        /* save the configure event for when the window maps */
+        w->need_configure = True;
+        w->queue_configure = *ce;
+        return;
+    }
+
 #if CAN_DO_USABLE
     if (w->usable)
 #endif
@@ -1592,9 +1612,7 @@ configure_win (Display *dpy, XConfigureEvent *ce)
     }
     w->a.x = ce->x;
     w->a.y = ce->y;
-    /* Only destroy the pixmap if the window is mapped */
-    if (w->a.map_state != IsUnmapped &&
-        (w->a.width != ce->width || w->a.height != ce->height))
+    if (w->a.width != ce->width || w->a.height != ce->height)
     {
 #if HAS_NAME_WINDOW_PIXMAP
        if (w->pixmap)