reversed Andreas Amann's fullscreen fix with the approach proposed by Gary Langshaw:

- idea is not supporting movemouse/resizemouse/togglefloating for fullscreen windows
- as fullscreen windows are broken anyways, they should only be adjusted by their own means
This commit is contained in:
anselm@garbe.us 2012-06-23 09:06:00 +02:00
parent 90f3238301
commit 820cbb3545
1 changed files with 10 additions and 11 deletions

21
dwm.c
View File

@ -575,8 +575,9 @@ configurenotify(XEvent *e) {
XConfigureEvent *ev = &e->xconfigure; XConfigureEvent *ev = &e->xconfigure;
Bool dirty; Bool dirty;
// TODO: updategeom handling sucks, needs to be simplified
if(ev->window == root) { if(ev->window == root) {
dirty = (sw != ev->width); dirty = (sw != ev->width || sh != ev->height);
sw = ev->width; sw = ev->width;
sh = ev->height; sh = ev->height;
if(updategeom() || dirty) { if(updategeom() || dirty) {
@ -1235,6 +1236,8 @@ movemouse(const Arg *arg) {
if(!(c = selmon->sel)) if(!(c = selmon->sel))
return; return;
if(c->isfullscreen) /* no support moving fullscreen windows by mouse */
return;
restack(selmon); restack(selmon);
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
@ -1268,11 +1271,8 @@ movemouse(const Arg *arg) {
&& (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) && (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
togglefloating(NULL); togglefloating(NULL);
} }
if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) { if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
if(c->isfullscreen)
setfullscreen(c, False);
resize(c, nx, ny, c->w, c->h, True); resize(c, nx, ny, c->w, c->h, True);
}
break; break;
} }
} while(ev.type != ButtonRelease); } while(ev.type != ButtonRelease);
@ -1382,6 +1382,8 @@ resizemouse(const Arg *arg) {
if(!(c = selmon->sel)) if(!(c = selmon->sel))
return; return;
if(c->isfullscreen) /* no support resizing fullscreen windows by mouse */
return;
restack(selmon); restack(selmon);
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
@ -1407,11 +1409,8 @@ resizemouse(const Arg *arg) {
&& (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) && (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
togglefloating(NULL); togglefloating(NULL);
} }
if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) { if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
if(c->isfullscreen)
setfullscreen(c, False);
resize(c, c->x, c->y, nw, nh, True); resize(c, c->x, c->y, nw, nh, True);
}
break; break;
} }
} while(ev.type != ButtonRelease); } while(ev.type != ButtonRelease);
@ -1759,12 +1758,12 @@ void
togglefloating(const Arg *arg) { togglefloating(const Arg *arg) {
if(!selmon->sel) if(!selmon->sel)
return; return;
if(selmon->sel->isfullscreen) /* no support for fullscreen windows */
return;
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if(selmon->sel->isfloating) if(selmon->sel->isfloating)
resize(selmon->sel, selmon->sel->x, selmon->sel->y, resize(selmon->sel, selmon->sel->x, selmon->sel->y,
selmon->sel->w, selmon->sel->h, False); selmon->sel->w, selmon->sel->h, False);
else if(selmon->sel->isfullscreen)
setfullscreen(selmon->sel, False);
arrange(selmon); arrange(selmon);
} }