Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
s/444/555/g - enlightened selected background
[dwm.git]
/
event.c
diff --git
a/event.c
b/event.c
index
c9ad387
..
75c3fa0
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-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,21
@@
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();
}
}
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)))
- drawclient(c);
}
}
}
}
@@
-262,10
+270,8
@@
static void
leavenotify(XEvent *e) {
XCrossingEvent *ev = &e->xcrossing;
leavenotify(XEvent *e) {
XCrossingEvent *ev = &e->xcrossing;
- if((ev->window == root) && !ev->same_screen)
{
+ if((ev->window == root) && !ev->same_screen)
issel = False;
issel = False;
- drawall();
- }
}
static void
}
static void
@@
-319,8
+325,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);
-
drawclient(c
);
+ if(c == sel)
+
drawstatus(
);
}
}
}
}
}
}