diff --git a/client.c b/client.c index fb1ef63f3..5e7a8ccf8 100644 --- a/client.c +++ b/client.c @@ -98,6 +98,24 @@ grabbuttons(Client * c, Bool focused, KeySym modkey, unsigned int numlockmask) XGrabButton(c->display, Button3, modkey | numlockmask | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button4, modkey, c->win, False, BUTTONMASK, + GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button4, modkey | LockMask, c->win, False, + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button4, modkey | numlockmask, c->win, False, + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button4, modkey | numlockmask | LockMask, + c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + + XGrabButton(c->display, Button5, modkey, c->win, False, BUTTONMASK, + GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button5, modkey | LockMask, c->win, False, + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button5, modkey | numlockmask, c->win, False, + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XGrabButton(c->display, Button5, modkey | numlockmask | LockMask, + c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); + XUngrabButton(c->display, AnyButton, AnyModifier, RootWindow(c->display, c->phys_screen)); } else @@ -304,6 +322,8 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config XSetWindowBorder(sel->display, sel->win, drawcontext->norm[ColBorder]); setclienttrans(sel, awesomeconf->opacity_unfocused); } + if(sel == c) + return; if(c) { detachstack(c); @@ -659,7 +679,7 @@ uicb_settrans(Display *disp __attribute__ ((unused)), awesome_config *awesomeconf __attribute__ ((unused)), const char *arg) { - double delta = 100.0, current_opacity = 0.0; + double delta = 100.0, current_opacity = 100.0; unsigned char *data; Atom actual; int format; diff --git a/event.c b/event.c index 7b8a357bb..9da5c93d3 100644 --- a/event.c +++ b/event.c @@ -219,7 +219,11 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]); resizemouse(c, &awesomeconf[c->screen]); } - } + else if(ev->button == Button4) + uicb_settrans(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], "+5"); + else if(ev->button == Button5) + uicb_settrans(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], "-5"); + } else if(!sel) for(screen = 0; screen < ScreenCount(e->xany.display); screen++) if(RootWindow(e->xany.display, screen) == ev->window