Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
removed procevent, more refactoring
[dwm.git]
/
event.c
diff --git
a/event.c
b/event.c
index
fbce631
..
4b3c1e3
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-20,6
+20,14
@@
KEYS
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
+static Client *
+getclient(Window w) {
+ Client *c;
+
+ for(c = clients; c && c->win != w; c = c->next);
+ return c;
+}
+
static void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
static void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
@@
-165,7
+173,6
@@
buttonpress(XEvent *e) {
static void
configurerequest(XEvent *e) {
static void
configurerequest(XEvent *e) {
- int x, y, w, h;
Client *c;
XConfigureRequestEvent *ev = &e->xconfigurerequest;
XWindowChanges wc;
Client *c;
XConfigureRequestEvent *ev = &e->xconfigurerequest;
XWindowChanges wc;
@@
-175,24
+182,19
@@
configurerequest(XEvent *e) {
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
if(c->isfixed || c->isfloat || (arrange == dofloat)) {
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
if(c->isfixed || c->isfloat || (arrange == dofloat)) {
- x = (ev->value_mask & CWX) ? ev->x : c->x;
- y = (ev->value_mask & CWY) ? ev->y : c->y;
- w = (ev->value_mask & CWWidth) ? ev->width : c->w;
- h = (ev->value_mask & CWHeight) ? ev->height : c->h;
+ if(ev->value_mask & CWX)
+ c->x = ev->x;
+ if(ev->value_mask & CWY)
+ c->y = ev->y;
+ if(ev->value_mask & CWWidth)
+ c->w = ev->width;
+ if(ev->value_mask & CWHeight)
+ c->h = ev->height;
if((ev->value_mask & (CWX | CWY))
&& !(ev->value_mask & (CWWidth | CWHeight)))
if((ev->value_mask & (CWX | CWY))
&& !(ev->value_mask & (CWWidth | CWHeight)))
- {
- c->x = x;
- c->y = y;
configure(c);
configure(c);
- if(isvisible(c))
- XMoveWindow(dpy, c->win, c->x, c->y);
- }
- else {
- resize(c, x, y, w, h, False);
- if(!isvisible(c))
- ban(c);
- }
+ if(isvisible(c))
+ XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
}
else
configure(c);
}
else
configure(c);
@@
-366,14
+368,3
@@
grabkeys(void) {
GrabModeAsync, GrabModeAsync);
}
}
GrabModeAsync, GrabModeAsync);
}
}
-
-void
-procevent(void) {
- XEvent ev;
-
- while(XPending(dpy)) {
- XNextEvent(dpy, &ev);
- if(handler[ev.type])
- (handler[ev.type])(&ev); /* call handler */
- }
-}