JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fix response to applications when windows are not reconfigured as requested.
authorReginald Kennedy <rk@rejii.com>
Wed, 1 Feb 2012 20:50:43 +0000 (04:50 +0800)
committerReginald Kennedy <rk@rejii.com>
Wed, 1 Feb 2012 20:50:43 +0000 (04:50 +0800)
This gives applications a chance to redraw the window contents to the actual, unchanged, window geometry.
Fixes issues with gvim, emacs, firefox, feh and many other applications.

ok marco

scrotwm.c

index 65cd807..b9bed4b 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -1643,33 +1643,31 @@ config_win(struct ws_win *win, XConfigureRequestEvent  *ev)
        if (win == NULL)
                return;
 
+       /* send notification of unchanged state. */
+       ce.type = ConfigureNotify;
+       ce.x = X(win);
+       ce.y = Y(win);
+       ce.width = WIDTH(win);
+       ce.height = HEIGHT(win);
+       ce.override_redirect = False;
 
        if (ev == NULL) {
                /* EWMH */
-               ce.type = ConfigureNotify;
                ce.display = display;
                ce.event = win->id;
                ce.window = win->id;
-               ce.x = X(win);
-               ce.y = Y(win);
-               ce.width = WIDTH(win);
-               ce.height = HEIGHT(win);
                ce.border_width = border_width;
                ce.above = None;
-               ce.override_redirect = False;
        } else {
                /* normal */
-               ce.type = ConfigureNotify;
                ce.display = ev->display;
                ce.event = ev->window;
                ce.window = ev->window;
-               ce.x = ev->x;
-               ce.y = ev->y;
-               ce.width = ev->width;
-               ce.height = ev->height;
+               /* adjust x and y for requested border_width. */
+               ce.x += border_width - ev->border_width;
+               ce.y += border_width - ev->border_width;
                ce.border_width = ev->border_width;
                ce.above = ev->above;
-               ce.override_redirect = False;
        }
 
        DNPRINTF(SWM_D_MISC, "config_win: ewmh: %s, window: 0x%lx, (x,y) w x h: "