From: Dana Jansens Date: Fri, 15 Feb 2008 05:55:17 +0000 (-0500) Subject: Save ConfigureNotify events for unmapped windows until the window maps. If a window... X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=7b62f76ca937c693c1b07f93b45bb1a9e7d64794;p=dana%2Fxcompmgr.git Save ConfigureNotify events for unmapped windows until the window maps. If a window moves while it is unmapped, it should not affect its fade-out. --- diff --git a/xcompmgr.c b/xcompmgr.c index baf68cf..f4dd9e4 100644 --- a/xcompmgr.c +++ b/xcompmgr.c @@ -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)