]> Pileus Git - wmpus/commitdiff
Allow adding hidden windows
authorAndy Spencer <andy753421@gmail.com>
Wed, 15 Apr 2015 19:51:54 +0000 (19:51 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 15 Apr 2015 19:51:54 +0000 (19:51 +0000)
This simplifies the system implementation because it can add windows as
soon as their created but before they're mapped. The WM can also keep
track of windows the entire time they exist.

wm-wmii.c

index ba6cea741473f7445305c07d50a04d7e59751111..e31f07422ec23b37da60e11379532fac9927a29e 100644 (file)
--- a/wm-wmii.c
+++ b/wm-wmii.c
@@ -330,7 +330,7 @@ static void put_win_col(win_t *win, tag_t *tag, dpy_t *dpy, col_t *col)
 {
        row_t *row = new0(row_t);
        row->win   = win;
-       row->state = win->state ?: ST_SHOW;
+       row->state = win->state;
 
        if (col == NULL) {
                col = new0(col_t);
@@ -901,6 +901,10 @@ void wm_insert(win_t *win)
        printf("wm_insert: %p\n", win);
        print_txt();
 
+       /* Make sure it's visible */
+       if (win->state == ST_HIDE)
+               return;
+
        /* Check for toolbars */
        if (win->type == TYPE_TOOLBAR)
                return wm_update();