X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=45191e9996b978881592627ce3c36b9b3417cf6b;hp=9702063616fbdaf0bcf86ab1f076cfe1a8157e8e;hb=1bdb393f81541506c9e7d8259855e30523b71238;hpb=3bfc43c3d01d710c4828d75a8a5a9b910ee90dff diff --git a/dwm.c b/dwm.c index 9702063..45191e9 100644 --- a/dwm.c +++ b/dwm.c @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef XINERAMA #include #endif /* XINERAMA */ @@ -575,8 +576,9 @@ configurenotify(XEvent *e) { XConfigureEvent *ev = &e->xconfigure; Bool dirty; + // TODO: updategeom handling sucks, needs to be simplified if(ev->window == root) { - dirty = (sw != ev->width); + dirty = (sw != ev->width || sh != ev->height); sw = ev->width; sh = ev->height; if(updategeom() || dirty) { @@ -884,7 +886,8 @@ focusmon(const Arg *arg) { return; if((m = dirtomon(arg->i)) == selmon) return; - unfocus(selmon->sel, True); + unfocus(selmon->sel, False); /* s/True/False/ fixes input focus issues + in gedit and anjuta */ selmon = m; focus(NULL); } @@ -1088,7 +1091,7 @@ keypress(XEvent *e) { XKeyEvent *ev; ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); + keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0); for(i = 0; i < LENGTH(keys); i++) if(keysym == keys[i].keysym && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) @@ -1234,6 +1237,8 @@ movemouse(const Arg *arg) { if(!(c = selmon->sel)) return; + if(c->isfullscreen) /* no support moving fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1267,11 +1272,8 @@ movemouse(const Arg *arg) { && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) togglefloating(NULL); } - if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - if(c->isfullscreen) - setfullscreen(c, False); + if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) resize(c, nx, ny, c->w, c->h, True); - } break; } } while(ev.type != ButtonRelease); @@ -1381,6 +1383,8 @@ resizemouse(const Arg *arg) { if(!(c = selmon->sel)) return; + if(c->isfullscreen) /* no support resizing fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1406,11 +1410,8 @@ resizemouse(const Arg *arg) { && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) togglefloating(NULL); } - if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - if(c->isfullscreen) - setfullscreen(c, False); + if(!selmon->lt[selmon->sellt]->arrange || c->isfloating) resize(c, c->x, c->y, nw, nh, True); - } break; } } while(ev.type != ButtonRelease); @@ -1758,12 +1759,12 @@ void togglefloating(const Arg *arg) { if(!selmon->sel) return; + if(selmon->sel->isfullscreen) /* no support for fullscreen windows */ + return; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; if(selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h, False); - else if(selmon->sel->isfullscreen) - setfullscreen(selmon->sel, False); arrange(selmon); }