X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=a2997cc167b4776114c2d2b2ecf6c5f2870de599;hb=af851bfc41facb5b4632d8b9938df2813be61684;hp=78f5af73247ac0311519e2701f72bda65eb196c8;hpb=df2352b39dacb4fc41960cc88f069a5d7f2f6d33;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 78f5af7..a2997cc 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -4777,10 +4777,6 @@ manage_window(Window id) XSelectInput(display, id, EnterWindowMask | FocusChangeMask | PropertyChangeMask | StructureNotifyMask); - if (win->iconic) - set_win_state(win, IconicState); - else - set_win_state(win, NormalState); /* floaters need to be mapped if they are in the current workspace */ if ((win->floating || win->transient) && (ws->idx == r->ws->idx)) @@ -5278,6 +5274,21 @@ unmapnotify(XEvent *e) if (getstate(e->xunmap.window) == NormalState) { unmanage_window(win); stack(); + + /* giant hack for apps that don't destroy transient windows */ + /* eat a bunch of events to prevent remanaging the window */ + XEvent cne; + while (XCheckWindowEvent(display, e->xunmap.window, + EnterWindowMask, &cne)) + ; + while (XCheckWindowEvent(display, e->xunmap.window, + StructureNotifyMask, &cne)) + ; + while (XCheckWindowEvent(display, e->xunmap.window, + SubstructureNotifyMask, &cne)) + ; + /* resend unmap because we ated it */ + XUnmapWindow(display, e->xunmap.window); } }