# HG changeset patch # User markus schnalke # Date 1339624800 -7200 # Node ID e65be4ffdbdc2437b8fa922133520ee52afe7054 # Parent 5fa2cf6026e8f5a01fbbc6d67615fdf3c0c37f00 Add handling for popup windows diff -r 5fa2cf6026e8 -r e65be4ffdbdc aewl.c --- a/aewl.c Sat Mar 17 19:10:42 2012 +0100 +++ b/aewl.c Thu Jun 14 00:00:00 2012 +0200 @@ -90,7 +90,7 @@ int minax, minay, maxax, maxay; long flags; unsigned int border; - Bool isfixed, isfloat, ismax; + Bool isfixed, isfloat, ismax, ispopup; Bool tag; Client *next; Client *prev; @@ -212,7 +212,7 @@ Client * nexttiled(Client *c) { - for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); + for(c = getnext(c); c && (c->isfloat || c->ispopup); c = getnext(c->next)); return c; } @@ -271,7 +271,7 @@ for(i = 0, c = clients; c; c = c->next) if(isvisible(c)) { - if(c->isfloat) { + if(c->isfloat || c->ispopup) { resize(c, True); continue; } @@ -311,7 +311,7 @@ for(c = clients; c; c = c->next) { if(isvisible(c)) { - if(c->isfloat) { + if(c->isfloat || c->ispopup) { resize(c, True); continue; } @@ -380,18 +380,15 @@ drawbar(); if(!sel) return; - /*if(sel->isfloat)*/ + if(sel->isfloat || sel->ispopup) XRaiseWindow(dpy, sel->win); - - /* - if(!sel->isfloat) + else XLowerWindow(dpy, sel->win); for(c = nexttiled(clients); c; c = nexttiled(c->next)) { if(c == sel) continue; XLowerWindow(dpy, c->win); } - */ XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); @@ -433,6 +430,7 @@ void toggleview() { if (viewfloats) { + floattoggle(); return; } seltag = !seltag; @@ -452,7 +450,7 @@ if(!sel) return; - if(sel->isfloat) { + if(sel->isfloat || sel->ispopup) { togglemax(sel); return; } @@ -533,6 +531,7 @@ if(trans) { c->tag = trans->tag; + c->isfloat = trans->isfloat; return; } c->tag = seltag; /* default */ @@ -662,10 +661,10 @@ focus(c); if(CLEANMASK(ev->state) != MODKEY) return; - if(ev->button == Button1 && c->isfloat) { + if(ev->button == Button1 && (c->isfloat || c->ispopup)) { restack(); movemouse(c); - } else if(ev->button == Button3 && c->isfloat && !c->isfixed) { + } else if(ev->button == Button3 && (c->isfloat || c->ispopup) && !c->isfixed) { restack(); resizemouse(c); } @@ -701,7 +700,7 @@ else configure(c); XSync(dpy, False); - if(c->isfloat) { + if(c->isfloat || c->ispopup) { resize(c, False); if(!isvisible(c)) XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); @@ -822,7 +821,7 @@ default: break; case XA_WM_TRANSIENT_FOR: XGetTransientForHint(dpy, c->win, &trans); - if(!c->isfloat && (c->isfloat = (trans != 0))) + if(!c->ispopup && (c->ispopup = (trans != 0))) arrange(); break; case XA_WM_NORMAL_HINTS: @@ -1216,8 +1215,8 @@ XSetWindowBorder(dpy, c->win, dc.norm[ColBG]); updatetitle(c); settag(c, getclient(trans)); - if(!c->isfloat) - c->isfloat = trans || c->isfixed; + if(!c->ispopup) + c->ispopup = trans || c->isfixed; if(clients) clients->prev = c; c->next = clients;