diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-13 20:28:19 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-13 20:28:19 +0200 |
| commit | 7fe717c29f9dafc4fc38313adbbb7c85619dec69 (patch) | |
| tree | bee9de83c270e21195f79ca86430f305cdd28fec | |
| parent | new stuff (diff) | |
| download | dwm-7fe717c29f9dafc4fc38313adbbb7c85619dec69.tar.gz dwm-7fe717c29f9dafc4fc38313adbbb7c85619dec69.zip | |
fixed several things, nearly feature complete
Diffstat (limited to '')
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | client.c | 55 | ||||
| -rw-r--r-- | dev.c | 4 | ||||
| -rw-r--r-- | dwm.h | 2 | ||||
| -rw-r--r-- | main.c | 2 |
5 files changed, 35 insertions, 29 deletions
| @@ -0,0 +1 @@ | |||
| - improve mouse based resizals with quadrant approach (then I think we have feature completeness already) | |||
| @@ -52,7 +52,7 @@ max(Arg *arg) | |||
| 52 | sel->w = sw - 2 * sel->border; | 52 | sel->w = sw - 2 * sel->border; |
| 53 | sel->h = sh - 2 * sel->border; | 53 | sel->h = sh - 2 * sel->border; |
| 54 | craise(sel); | 54 | craise(sel); |
| 55 | resize(sel); | 55 | resize(sel, False); |
| 56 | discard_events(EnterWindowMask); | 56 | discard_events(EnterWindowMask); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -100,7 +100,7 @@ floating(Arg *arg) | |||
| 100 | arrange = floating; | 100 | arrange = floating; |
| 101 | for(c = clients; c; c = c->next) { | 101 | for(c = clients; c; c = c->next) { |
| 102 | if(c->tags[tsel]) | 102 | if(c->tags[tsel]) |
| 103 | resize(c); | 103 | resize(c, True); |
| 104 | else | 104 | else |
| 105 | ban_client(c); | 105 | ban_client(c); |
| 106 | } | 106 | } |
| @@ -125,29 +125,29 @@ tiling(Arg *arg) | |||
| 125 | if(c->tags[tsel]) | 125 | if(c->tags[tsel]) |
| 126 | n++; | 126 | n++; |
| 127 | 127 | ||
| 128 | h = (n > 2) ? sh / (n - 2) : sh; | 128 | h = (n > 1) ? sh / (n - 1) : sh; |
| 129 | 129 | ||
| 130 | for(i = 0, c = clients; c; c = c->next) { | 130 | for(i = 0, c = clients; c; c = c->next) { |
| 131 | if(c->tags[tsel]) { | 131 | if(c->tags[tsel]) { |
| 132 | if(n == 1) { | 132 | if(n == 1) { |
| 133 | c->x = sx; | 133 | c->x = sx; |
| 134 | c->y = sy; | 134 | c->y = sy; |
| 135 | c->w = sw; | 135 | c->w = sw - 2 * c->border; |
| 136 | c->h = sh; | 136 | c->h = sh - 2 * c->border; |
| 137 | } | 137 | } |
| 138 | else if(i == 1) { | 138 | else if(i == 0) { |
| 139 | c->x = sx; | 139 | c->x = sx; |
| 140 | c->y = sy; | 140 | c->y = sy; |
| 141 | c->w = mw; | 141 | c->w = mw - 2 * c->border; |
| 142 | c->h = sh; | 142 | c->h = sh - 2 * c->border; |
| 143 | } | 143 | } |
| 144 | else { | 144 | else { |
| 145 | c->x = sx + mw; | 145 | c->x = sx + mw; |
| 146 | c->y = sy + (i - 2) * h; | 146 | c->y = sy + (i - 1) * h; |
| 147 | c->w = w; | 147 | c->w = w - 2 * c->border; |
| 148 | c->h = h; | 148 | c->h = h - 2 * c->border; |
| 149 | } | 149 | } |
| 150 | resize(c); | 150 | resize(c, False); |
| 151 | i++; | 151 | i++; |
| 152 | } | 152 | } |
| 153 | else | 153 | else |
| @@ -304,14 +304,11 @@ lower(Client *c) | |||
| 304 | void | 304 | void |
| 305 | focus(Client *c) | 305 | focus(Client *c) |
| 306 | { | 306 | { |
| 307 | if(sel && sel != c) { | 307 | Client *old = sel; |
| 308 | XSetWindowBorder(dpy, sel->win, dc.bg); | 308 | |
| 309 | XMapWindow(dpy, sel->title); | ||
| 310 | draw_client(sel); | ||
| 311 | } | ||
| 312 | sel = c; | 309 | sel = c; |
| 313 | XUnmapWindow(dpy, c->title); | 310 | if(old && old != c) |
| 314 | XSetWindowBorder(dpy, c->win, dc.fg); | 311 | draw_client(old); |
| 315 | draw_client(c); | 312 | draw_client(c); |
| 316 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); | 313 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); |
| 317 | XFlush(dpy); | 314 | XFlush(dpy); |
| @@ -463,14 +460,16 @@ gravitate(Client *c, Bool invert) | |||
| 463 | 460 | ||
| 464 | 461 | ||
| 465 | void | 462 | void |
| 466 | resize(Client *c) | 463 | resize(Client *c, Bool inc) |
| 467 | { | 464 | { |
| 468 | XConfigureEvent e; | 465 | XConfigureEvent e; |
| 469 | 466 | ||
| 470 | if(c->incw) | 467 | if(inc) { |
| 471 | c->w -= (c->w - c->basew) % c->incw; | 468 | if(c->incw) |
| 472 | if(c->inch) | 469 | c->w -= (c->w - c->basew) % c->incw; |
| 473 | c->h -= (c->h - c->baseh) % c->inch; | 470 | if(c->inch) |
| 471 | c->h -= (c->h - c->baseh) % c->inch; | ||
| 472 | } | ||
| 474 | if(c->minw && c->w < c->minw) | 473 | if(c->minw && c->w < c->minw) |
| 475 | c->w = c->minw; | 474 | c->w = c->minw; |
| 476 | if(c->minh && c->h < c->minh) | 475 | if(c->minh && c->h < c->minh) |
| @@ -554,8 +553,14 @@ void | |||
| 554 | draw_client(Client *c) | 553 | draw_client(Client *c) |
| 555 | { | 554 | { |
| 556 | int i; | 555 | int i; |
| 557 | if(c == sel) | 556 | if(c == sel) { |
| 557 | XUnmapWindow(dpy, c->title); | ||
| 558 | XSetWindowBorder(dpy, c->win, dc.fg); | ||
| 558 | return; | 559 | return; |
| 560 | } | ||
| 561 | |||
| 562 | XSetWindowBorder(dpy, c->win, dc.bg); | ||
| 563 | XMapWindow(dpy, c->title); | ||
| 559 | 564 | ||
| 560 | dc.x = dc.y = 0; | 565 | dc.x = dc.y = 0; |
| 561 | dc.h = c->th; | 566 | dc.h = c->th; |
| @@ -104,7 +104,7 @@ mresize(Client *c) | |||
| 104 | c->h = abs(ocy - ev.xmotion.y); | 104 | c->h = abs(ocy - ev.xmotion.y); |
| 105 | c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; | 105 | c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; |
| 106 | c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; | 106 | c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; |
| 107 | resize(c); | 107 | resize(c, True); |
| 108 | break; | 108 | break; |
| 109 | case ButtonRelease: | 109 | case ButtonRelease: |
| 110 | XUngrabPointer(dpy, CurrentTime); | 110 | XUngrabPointer(dpy, CurrentTime); |
| @@ -138,7 +138,7 @@ mmove(Client *c) | |||
| 138 | XFlush(dpy); | 138 | XFlush(dpy); |
| 139 | c->x = ocx + (ev.xmotion.x - x1); | 139 | c->x = ocx + (ev.xmotion.x - x1); |
| 140 | c->y = ocy + (ev.xmotion.y - y1); | 140 | c->y = ocy + (ev.xmotion.y - y1); |
| 141 | resize(c); | 141 | resize(c, False); |
| 142 | break; | 142 | break; |
| 143 | case ButtonRelease: | 143 | case ButtonRelease: |
| 144 | XUngrabPointer(dpy, CurrentTime); | 144 | XUngrabPointer(dpy, CurrentTime); |
| @@ -106,7 +106,7 @@ extern Client *getclient(Window w); | |||
| 106 | extern void focus(Client *c); | 106 | extern void focus(Client *c); |
| 107 | extern void update_name(Client *c); | 107 | extern void update_name(Client *c); |
| 108 | extern void draw_client(Client *c); | 108 | extern void draw_client(Client *c); |
| 109 | extern void resize(Client *c); | 109 | extern void resize(Client *c, Bool inc); |
| 110 | extern void update_size(Client *c); | 110 | extern void update_size(Client *c); |
| 111 | extern Client *gettitle(Window w); | 111 | extern Client *gettitle(Window w); |
| 112 | extern void craise(Client *c); | 112 | extern void craise(Client *c); |
| @@ -168,7 +168,7 @@ static void | |||
| 168 | cleanup() | 168 | cleanup() |
| 169 | { | 169 | { |
| 170 | while(sel) { | 170 | while(sel) { |
| 171 | resize(sel); | 171 | resize(sel, True); |
| 172 | unmanage(sel); | 172 | unmanage(sel); |
| 173 | } | 173 | } |
| 174 | XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); | 174 | XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); |
