diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-05-07 13:12:41 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-05-07 13:12:41 +0200 |
| commit | f9e7a330190259a54449837a16c2af66fa823d30 (patch) | |
| tree | a85452d878a8527bdcac2cefd86878271ccd0cab | |
| parent | Added tag 4.0 for changeset 018c38468422 (diff) | |
| download | dwm-f9e7a330190259a54449837a16c2af66fa823d30.tar.gz dwm-f9e7a330190259a54449837a16c2af66fa823d30.zip | |
applied patch of Paul Liu to allow onthefly resizing due to xrandr changes
Diffstat (limited to '')
| -rw-r--r-- | event.c | 19 | ||||
| -rw-r--r-- | layout.c | 5 | ||||
| -rw-r--r-- | main.c | 3 |
3 files changed, 25 insertions, 2 deletions
| @@ -208,6 +208,24 @@ configurerequest(XEvent *e) { | |||
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | static void | 210 | static void |
| 211 | configurenotify(XEvent *e) { | ||
| 212 | Client *c; | ||
| 213 | XConfigureEvent *ev = &e->xconfigure; | ||
| 214 | XWindowChanges wc; | ||
| 215 | |||
| 216 | if (ev->window == root && (ev->width != sw || ev->height != sh)) { | ||
| 217 | sw = ev->width; | ||
| 218 | sh = ev->height; | ||
| 219 | wah = sh - bh; | ||
| 220 | waw = sw; | ||
| 221 | XFreePixmap(dpy, dc.drawable); | ||
| 222 | dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); | ||
| 223 | XResizeWindow(dpy, barwin, sw, bh); | ||
| 224 | lt->arrange(); | ||
| 225 | } | ||
| 226 | } | ||
| 227 | |||
| 228 | static void | ||
| 211 | destroynotify(XEvent *e) { | 229 | destroynotify(XEvent *e) { |
| 212 | Client *c; | 230 | Client *c; |
| 213 | XDestroyWindowEvent *ev = &e->xdestroywindow; | 231 | XDestroyWindowEvent *ev = &e->xdestroywindow; |
| @@ -333,6 +351,7 @@ unmapnotify(XEvent *e) { | |||
| 333 | void (*handler[LASTEvent]) (XEvent *) = { | 351 | void (*handler[LASTEvent]) (XEvent *) = { |
| 334 | [ButtonPress] = buttonpress, | 352 | [ButtonPress] = buttonpress, |
| 335 | [ConfigureRequest] = configurerequest, | 353 | [ConfigureRequest] = configurerequest, |
| 354 | [ConfigureNotify] = configurenotify, | ||
| 336 | [DestroyNotify] = destroynotify, | 355 | [DestroyNotify] = destroynotify, |
| 337 | [EnterNotify] = enternotify, | 356 | [EnterNotify] = enternotify, |
| 338 | [LeaveNotify] = leavenotify, | 357 | [LeaveNotify] = leavenotify, |
| @@ -46,7 +46,10 @@ tile(void) { | |||
| 46 | nw = tw - 2 * c->border; | 46 | nw = tw - 2 * c->border; |
| 47 | if(th > 2 * c->border) { | 47 | if(th > 2 * c->border) { |
| 48 | ny += (i - nmaster) * th; | 48 | ny += (i - nmaster) * th; |
| 49 | nh = th - 2 * c->border; | 49 | if(i == n - 1) |
| 50 | nh = wah - ny - 2 * c->border; | ||
| 51 | else | ||
| 52 | nh = th - 2 * c->border; | ||
| 50 | } | 53 | } |
| 51 | else /* fallback if th <= 2 * c->border */ | 54 | else /* fallback if th <= 2 * c->border */ |
| 52 | nh = wah - 2 * c->border; | 55 | nh = wah - 2 * c->border; |
| @@ -163,9 +163,10 @@ setup(void) { | |||
| 163 | XFreeModifiermap(modmap); | 163 | XFreeModifiermap(modmap); |
| 164 | /* select for events */ | 164 | /* select for events */ |
| 165 | wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | 165 | wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
| 166 | | EnterWindowMask | LeaveWindowMask; | 166 | | EnterWindowMask | LeaveWindowMask | StructureNotifyMask; |
| 167 | wa.cursor = cursor[CurNormal]; | 167 | wa.cursor = cursor[CurNormal]; |
| 168 | XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); | 168 | XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); |
| 169 | XSelectInput(dpy, root, wa.event_mask); | ||
| 169 | grabkeys(); | 170 | grabkeys(); |
| 170 | compileregs(); | 171 | compileregs(); |
| 171 | for(ntags = 0; tags[ntags]; ntags++); | 172 | for(ntags = 0; tags[ntags]; ntags++); |
