diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-12 15:17:22 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-12 15:17:22 +0200 |
| commit | dfd84f9bf3b9d949412a73bc62a43109b340d395 (patch) | |
| tree | ebeac582951e2ef574f50018298c4bc928849d64 /event.c | |
| parent | fixed configurerequest (diff) | |
| download | dwm-dfd84f9bf3b9d949412a73bc62a43109b340d395.tar.gz dwm-dfd84f9bf3b9d949412a73bc62a43109b340d395.zip | |
simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
Diffstat (limited to '')
| -rw-r--r-- | event.c | 17 |
1 files changed, 6 insertions, 11 deletions
| @@ -37,13 +37,11 @@ void (*handler[LASTEvent]) (XEvent *) = { | |||
| 37 | [UnmapNotify] = unmapnotify | 37 | [UnmapNotify] = unmapnotify |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | unsigned int | 40 | void |
| 41 | discard_events(long even_mask) | 41 | discard_events(long even_mask) |
| 42 | { | 42 | { |
| 43 | XEvent ev; | 43 | XEvent ev; |
| 44 | unsigned int n = 0; | 44 | while(XCheckMaskEvent(dpy, even_mask, &ev)); |
| 45 | while(XCheckMaskEvent(dpy, even_mask, &ev)) n++; | ||
| 46 | return n; | ||
| 47 | } | 45 | } |
| 48 | 46 | ||
| 49 | static void | 47 | static void |
| @@ -53,6 +51,7 @@ buttonpress(XEvent *e) | |||
| 53 | Client *c; | 51 | Client *c; |
| 54 | 52 | ||
| 55 | if((c = getclient(ev->window))) { | 53 | if((c = getclient(ev->window))) { |
| 54 | raise(c); | ||
| 56 | switch(ev->button) { | 55 | switch(ev->button) { |
| 57 | default: | 56 | default: |
| 58 | break; | 57 | break; |
| @@ -60,7 +59,7 @@ buttonpress(XEvent *e) | |||
| 60 | mmove(c); | 59 | mmove(c); |
| 61 | break; | 60 | break; |
| 62 | case Button2: | 61 | case Button2: |
| 63 | XLowerWindow(dpy, c->win); | 62 | lower(c); |
| 64 | break; | 63 | break; |
| 65 | case Button3: | 64 | case Button3: |
| 66 | mresize(c); | 65 | mresize(c); |
| @@ -122,10 +121,8 @@ enternotify(XEvent *e) | |||
| 122 | 121 | ||
| 123 | if((c = getclient(ev->window))) | 122 | if((c = getclient(ev->window))) |
| 124 | focus(c); | 123 | focus(c); |
| 125 | else if(ev->window == root) { | 124 | else if(ev->window == root) |
| 126 | sel_screen = True; | 125 | sel_screen = True; |
| 127 | /*draw_frames();*/ | ||
| 128 | } | ||
| 129 | } | 126 | } |
| 130 | 127 | ||
| 131 | static void | 128 | static void |
| @@ -133,10 +130,8 @@ leavenotify(XEvent *e) | |||
| 133 | { | 130 | { |
| 134 | XCrossingEvent *ev = &e->xcrossing; | 131 | XCrossingEvent *ev = &e->xcrossing; |
| 135 | 132 | ||
| 136 | if((ev->window == root) && !ev->same_screen) { | 133 | if((ev->window == root) && !ev->same_screen) |
| 137 | sel_screen = True; | 134 | sel_screen = True; |
| 138 | /*draw_frames();*/ | ||
| 139 | } | ||
| 140 | } | 135 | } |
| 141 | 136 | ||
| 142 | static void | 137 | static void |
