X-Git-Url: http://pileus.org/git/?p=wmpus;a=blobdiff_plain;f=sys-x11.c;fp=sys-x11.c;h=1a7c7e016f45c12f47d6b8d19b972ed1449a2dd5;hp=68baaee22cb16540683f1aedbc281e0d773ca140;hb=853b20d942c746cc8ebb5e6fe33386e1ed9f3525;hpb=4e518d22350583e6607889194485bfed2c160db6 diff --git a/sys-x11.c b/sys-x11.c index 68baaee..1a7c7e0 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -404,10 +404,8 @@ static void process_event(int type, XEvent *xe, win_t *root) else if (type == UnmapNotify) { if ((win = win_find(dpy,xe->xunmap.window,0)) && win->state != ST_HIDE) { - if (!strut_del(root, win)) - wm_remove(win); - else - wm_update(); + strut_del(root, win); + wm_remove(win); win->state = ST_HIDE; } } @@ -444,10 +442,9 @@ static void process_event(int type, XEvent *xe, win_t *root) if (win_prop(win, NET_STATE) == atoms[NET_FULL]) win->state = ST_FULL; XSelectInput(win->sys->dpy, win->sys->xid, PropertyChangeMask); - if (!strut_add(root, win)) - wm_insert(win); - else - wm_update(); + if (strut_add(root, win)) + win->type = TYPE_TOOLBAR; + wm_insert(win); } sys_show(win, win->state); } @@ -712,12 +709,14 @@ void sys_run(win_t *root) &par, &xid, &kids, &nkids)) { for(int i = 0; i < nkids; i++) { win_t *win = win_find(root->sys->dpy, kids[i], 1); - if (win && win_viewable(win) && !strut_add(root,win)) + if (win && win_viewable(win)) { + if (strut_add(root,win)) + win->type = TYPE_TOOLBAR; wm_insert(win); + } } XFree(kids); } - wm_update(); // For struts } /* Main loop */