aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-02 10:48:58 +0200
committerarg@10ksloc.org <unknown>2006-08-02 10:48:58 +0200
commit57871415c16664cce494b68dd3e985bcb32942c5 (patch)
tree1d0574e3a5cdf6fecc145dc65db5061e7c19b7d3 /client.c
parent52021851d1fd78970dfe63380d51b87f57d1ee1b (diff)
downloaddwm-57871415c16664cce494b68dd3e985bcb32942c5.tar.gz
reverting to old resize policy
Diffstat (limited to 'client.c')
-rw-r--r--client.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/client.c b/client.c
index f90a182..434a93b 100644
--- a/client.c
+++ b/client.c
@@ -271,7 +271,7 @@ resize(Client *c, Bool sizehints, Corner sticky)
{
int bottom = c->y + c->h;
int right = c->x + c->w;
- XWindowChanges wc;
+ XConfigureEvent e;
if(sizehints) {
if(c->incw)
@@ -287,22 +287,30 @@ resize(Client *c, Bool sizehints, Corner sticky)
if(c->maxh && c->h > c->maxh)
c->h = c->maxh;
}
+ if(c->x > sw) /* might happen on restart */
+ c->x = sw - c->w;
+ if(c->y > sh)
+ c->y = sh - c->h;
if(sticky == TopRight || sticky == BotRight)
c->x = right - c->w;
if(sticky == BotLeft || sticky == BotRight)
c->y = bottom - c->h;
resizetitle(c);
-
- if(c->tags[tsel])
- wc.x = c->x;
- else
- wc.x = c->x + 2 * sw;
- wc.y = c->y;
- wc.width = c->w;
- wc.height = c->h;
- wc.border_width = 1;
- XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ XSetWindowBorderWidth(dpy, c->win, 1);
+ XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
+
+ e.type = ConfigureNotify;
+ e.event = c->win;
+ e.window = c->win;
+ e.x = c->x;
+ e.y = c->y;
+ e.width = c->w;
+ e.height = c->h;
+ e.border_width = c->border;
+ e.above = None;
+ e.override_redirect = False;
+ XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
XSync(dpy, False);
}