Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
yet another multihead fix by Christof Musik
[dwm.git]
/
event.c
diff --git
a/event.c
b/event.c
index
b23fd3f
..
20c1533
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-1,4
+1,4
@@
-/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
+/* (C)opyright MMVI
-MMVII
Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include "dwm.h"
* See LICENSE file for license details.
*/
#include "dwm.h"
@@
-131,8
+131,20
@@
buttonpress(XEvent *e) {
return;
}
}
return;
}
}
- if((ev->x < x + bmw) && (ev->button == Button1))
- togglemode(NULL);
+ if(ev->x < x + bmw)
+ switch(ev->button) {
+ case Button1:
+ togglemode(NULL);
+ break;
+ case Button4:
+ a.i = 1;
+ incnmaster(&a);
+ break;
+ case Button5:
+ a.i = -1;
+ incnmaster(&a);
+ break;
+ }
}
else if((c = getclient(ev->window))) {
focus(c);
}
else if((c = getclient(ev->window))) {
focus(c);
@@
-184,7
+196,7
@@
configurerequest(XEvent *e) {
if(c->isfloat) {
resize(c, False, TopLeft);
if(!isvisible(c))
if(c->isfloat) {
resize(c, False, TopLeft);
if(!isvisible(c))
-
ban(c
);
+
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y
);
}
else
arrange();
}
else
arrange();
@@
-218,25
+230,23
@@
enternotify(XEvent *e) {
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
- if((
(c = getclient(ev->window)) || (c = getctitle(ev->window)
)) && isvisible(c))
+ if((
c = getclient(ev->window
)) && isvisible(c))
focus(c);
else if(ev->window == root) {
issel = True;
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
focus(c);
else if(ev->window == root) {
issel = True;
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- drawall();
+ if(sel)
+ XSetWindowBorder(dpy, sel->win, dc.sel[ColBorder]);
}
}
static void
expose(XEvent *e) {
}
}
static void
expose(XEvent *e) {
- Client *c;
XExposeEvent *ev = &e->xexpose;
if(ev->count == 0) {
if(barwin == ev->window)
drawstatus();
XExposeEvent *ev = &e->xexpose;
if(ev->count == 0) {
if(barwin == ev->window)
drawstatus();
- else if((c = getctitle(ev->window)))
- drawtitle(c);
}
}
}
}
@@
-264,7
+274,8
@@
leavenotify(XEvent *e) {
if((ev->window == root) && !ev->same_screen) {
issel = False;
if((ev->window == root) && !ev->same_screen) {
issel = False;
- drawall();
+ if(sel)
+ XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
}
}
}
}
@@
-319,8
+330,8
@@
propertynotify(XEvent *e) {
}
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
updatetitle(c);
}
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
updatetitle(c);
- resizetitle(c);
-
drawtitle(c
);
+ if(c == sel)
+
drawstatus(
);
}
}
}
}
}
}