]> Pileus Git - wmpus/commitdiff
Configure window when set to stack mode
authorAndy Spencer <andy753421@gmail.com>
Mon, 9 Jul 2012 05:41:38 +0000 (05:41 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 9 Jul 2012 05:41:38 +0000 (05:41 +0000)
This matches the win32 behavior and prevents stacked windows from
overlapping each other. This causes some flickering in pidign, possibly
because the text area overlaps the menu bar when the window is shaded.

sys-x11.c

index c55e5372892daaf1e62e6a1df56d44a1a25d3ead..68baaee22cb16540683f1aedbc281e0d773ca140 100644 (file)
--- a/sys-x11.c
+++ b/sys-x11.c
@@ -32,6 +32,7 @@
 /* Configuration */
 static int border     = 2;
 static int no_capture = 0;
+static int stack      = 25;
 
 /* Internal structures */
 struct win_sys {
@@ -584,6 +585,8 @@ void sys_show(win_t *win, state_t state)
                break;
        case ST_SHADE:
                printf("sys_show: shade %p\n", win);
+               XConfigureWindow(win->sys->dpy, win->sys->xid, CWHeight,
+                               &(XWindowChanges){ .height = stack });
                XMapWindow(win->sys->dpy, win->sys->xid);
                break;
        case ST_ICON:
@@ -667,6 +670,7 @@ win_t *sys_init(void)
        Window   xid;
 
        /* Load configuration */
+       stack      = conf_get_int("main.stack",      stack);
        border     = conf_get_int("main.border",     border);
        no_capture = conf_get_int("main.no-capture", no_capture);