summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-06-01 07:06:27 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2011-06-01 07:06:27 +0200
commit9d7112dc6f9b179ee44e5b47453173160e0f14fd (patch)
treeb94218606f4c1e5a4109f9ea62572384e8b7a05a
parent191c260a06c8d8c40d2acd9e46f0e601037e723a (diff)
downloadmcwm-9d7112dc6f9b179ee44e5b47453173160e0f14fd.zip
Moving to corners must change client's coords.
-rw-r--r--mcwm.c48
1 files changed, 18 insertions, 30 deletions
diff --git a/mcwm.c b/mcwm.c
index 3aa9d1e..2ad6fe2 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -2684,8 +2684,10 @@ void topleft(void)
{
return;
}
-
- movewindow(focuswin->id, mon_x, mon_y);
+
+ focuswin->x = mon_x;
+ focuswin->y = mon_y;
+ movewindow(focuswin->id, focuswin->x, focuswin->y);
xcb_warp_pointer(conn, XCB_NONE, focuswin->id, 0, 0, 0, 0,
pointx, pointy);
xcb_flush(conn);
@@ -2730,8 +2732,10 @@ void topright(void)
return;
}
- movewindow(focuswin->id, mon_width
- - (width + BORDERWIDTH * 2), mon_y);
+ focuswin->x = mon_width - (width + BORDERWIDTH * 2);
+ focuswin->y = mon_y;
+
+ movewindow(focuswin->id, focuswin->x, focuswin->y);
xcb_warp_pointer(conn, XCB_NONE, focuswin->id, 0, 0, 0, 0,
pointx, pointy);
@@ -2741,10 +2745,6 @@ void topright(void)
void botleft(void)
{
- int16_t x;
- int16_t y;
- uint16_t width;
- uint16_t height;
int16_t pointx;
int16_t pointy;
int16_t mon_x;
@@ -2775,14 +2775,11 @@ void botleft(void)
{
return;
}
-
- if (!getgeom(focuswin->id, &x, &y, &width, &height))
- {
- return;
- }
-
- movewindow(focuswin->id, mon_x, mon_y + mon_height
- - (height + BORDERWIDTH * 2));
+
+ focuswin->x = mon_x;
+ focuswin->y = mon_y + mon_height - (focuswin->height + BORDERWIDTH * 2);
+
+ movewindow(focuswin->id, focuswin->x, focuswin->y);
xcb_warp_pointer(conn, XCB_NONE, focuswin->id, 0, 0, 0, 0,
pointx, pointy);
@@ -2791,10 +2788,6 @@ void botleft(void)
void botright(void)
{
- int16_t x;
- int16_t y;
- uint16_t width;
- uint16_t height;
int16_t pointx;
int16_t pointy;
int16_t mon_x;
@@ -2828,17 +2821,12 @@ void botright(void)
{
return;
}
+
+ focuswin->x = mon_x + mon_width - (focuswin->width + BORDERWIDTH * 2);
+
+ focuswin->y = mon_y + mon_height - (focuswin->height + BORDERWIDTH * 2);
- if (!getgeom(focuswin->id, &x, &y, &width, &height))
- {
- return;
- }
-
- movewindow(focuswin->id,
- mon_x + mon_width
- - (width + BORDERWIDTH * 2),
- mon_y + mon_height
- - (height + BORDERWIDTH * 2));
+ movewindow(focuswin->id, focuswin->x, focuswin->y);
xcb_warp_pointer(conn, XCB_NONE, focuswin->id, 0, 0, 0, 0,
pointx, pointy);