aewl
changeset 786:e65be4ffdbdc
Add handling for popup windows
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 14 Jun 2012 00:00:00 +0200 |
parents | 5fa2cf6026e8 |
children | eecb13b34511 |
files | aewl.c |
diffstat | 1 files changed, 15 insertions(+), 16 deletions(-) [+] |
line diff
1.1 --- a/aewl.c Sat Mar 17 19:10:42 2012 +0100 1.2 +++ b/aewl.c Thu Jun 14 00:00:00 2012 +0200 1.3 @@ -90,7 +90,7 @@ 1.4 int minax, minay, maxax, maxay; 1.5 long flags; 1.6 unsigned int border; 1.7 - Bool isfixed, isfloat, ismax; 1.8 + Bool isfixed, isfloat, ismax, ispopup; 1.9 Bool tag; 1.10 Client *next; 1.11 Client *prev; 1.12 @@ -212,7 +212,7 @@ 1.13 1.14 Client * 1.15 nexttiled(Client *c) { 1.16 - for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); 1.17 + for(c = getnext(c); c && (c->isfloat || c->ispopup); c = getnext(c->next)); 1.18 return c; 1.19 } 1.20 1.21 @@ -271,7 +271,7 @@ 1.22 1.23 for(i = 0, c = clients; c; c = c->next) 1.24 if(isvisible(c)) { 1.25 - if(c->isfloat) { 1.26 + if(c->isfloat || c->ispopup) { 1.27 resize(c, True); 1.28 continue; 1.29 } 1.30 @@ -311,7 +311,7 @@ 1.31 1.32 for(c = clients; c; c = c->next) { 1.33 if(isvisible(c)) { 1.34 - if(c->isfloat) { 1.35 + if(c->isfloat || c->ispopup) { 1.36 resize(c, True); 1.37 continue; 1.38 } 1.39 @@ -380,18 +380,15 @@ 1.40 drawbar(); 1.41 if(!sel) 1.42 return; 1.43 - /*if(sel->isfloat)*/ 1.44 + if(sel->isfloat || sel->ispopup) 1.45 XRaiseWindow(dpy, sel->win); 1.46 - 1.47 - /* 1.48 - if(!sel->isfloat) 1.49 + else 1.50 XLowerWindow(dpy, sel->win); 1.51 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { 1.52 if(c == sel) 1.53 continue; 1.54 XLowerWindow(dpy, c->win); 1.55 } 1.56 - */ 1.57 1.58 XSync(dpy, False); 1.59 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 1.60 @@ -433,6 +430,7 @@ 1.61 void 1.62 toggleview() { 1.63 if (viewfloats) { 1.64 + floattoggle(); 1.65 return; 1.66 } 1.67 seltag = !seltag; 1.68 @@ -452,7 +450,7 @@ 1.69 1.70 if(!sel) 1.71 return; 1.72 - if(sel->isfloat) { 1.73 + if(sel->isfloat || sel->ispopup) { 1.74 togglemax(sel); 1.75 return; 1.76 } 1.77 @@ -533,6 +531,7 @@ 1.78 1.79 if(trans) { 1.80 c->tag = trans->tag; 1.81 + c->isfloat = trans->isfloat; 1.82 return; 1.83 } 1.84 c->tag = seltag; /* default */ 1.85 @@ -662,10 +661,10 @@ 1.86 focus(c); 1.87 if(CLEANMASK(ev->state) != MODKEY) 1.88 return; 1.89 - if(ev->button == Button1 && c->isfloat) { 1.90 + if(ev->button == Button1 && (c->isfloat || c->ispopup)) { 1.91 restack(); 1.92 movemouse(c); 1.93 - } else if(ev->button == Button3 && c->isfloat && !c->isfixed) { 1.94 + } else if(ev->button == Button3 && (c->isfloat || c->ispopup) && !c->isfixed) { 1.95 restack(); 1.96 resizemouse(c); 1.97 } 1.98 @@ -701,7 +700,7 @@ 1.99 else 1.100 configure(c); 1.101 XSync(dpy, False); 1.102 - if(c->isfloat) { 1.103 + if(c->isfloat || c->ispopup) { 1.104 resize(c, False); 1.105 if(!isvisible(c)) 1.106 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 1.107 @@ -822,7 +821,7 @@ 1.108 default: break; 1.109 case XA_WM_TRANSIENT_FOR: 1.110 XGetTransientForHint(dpy, c->win, &trans); 1.111 - if(!c->isfloat && (c->isfloat = (trans != 0))) 1.112 + if(!c->ispopup && (c->ispopup = (trans != 0))) 1.113 arrange(); 1.114 break; 1.115 case XA_WM_NORMAL_HINTS: 1.116 @@ -1216,8 +1215,8 @@ 1.117 XSetWindowBorder(dpy, c->win, dc.norm[ColBG]); 1.118 updatetitle(c); 1.119 settag(c, getclient(trans)); 1.120 - if(!c->isfloat) 1.121 - c->isfloat = trans || c->isfixed; 1.122 + if(!c->ispopup) 1.123 + c->ispopup = trans || c->isfixed; 1.124 if(clients) 1.125 clients->prev = c; 1.126 c->next = clients;