tMake teleportation act on currently active window - glazier - window management experiments
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 155eb51908acbf193ac72350cc0f89599130c027
DIR parent 128f54e2720da1160ea60a038732fc4c5b958e45
HTML Author: Willy Goiffon <dev@z3bra.org>
Date: Wed, 11 Dec 2019 12:40:22 +0100
Make teleportation act on currently active window
Diffstat:
M glazier.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
---
DIR diff --git a/glazier.c b/glazier.c
t@@ -364,7 +364,7 @@ cb_mouse_press(xcb_generic_event_t *ev)
wm_reg_cursor_event(scrn->root, mask, xhair[XHAIR_MOVE]);
break;
case 2:
- curwid = wid;
+ /* teleport acts on the last focused window */
cursor.x = e->root_x;
cursor.y = e->root_y;
cursor.mode = GRAB_TELE;
t@@ -502,20 +502,10 @@ cb_motion(xcb_generic_event_t *ev)
outline(scrn->root, x, y, w, h);
break;
case XCB_BUTTON_MASK_2:
- if (cursor.x > e->root_x) {
- x = e->root_x;
- w = cursor.x - x;
- } else {
- x = cursor.x;
- w = e->root_x - x;
- }
- if (cursor.y > e->root_y) {
- y = e->root_y;
- h = cursor.y - y;
- } else {
- y = cursor.y;
- h = e->root_y - y;
- }
+ x = MIN(cursor.x, e->root_x);
+ y = MIN(cursor.y, e->root_y);
+ w = MAX(cursor.x - e->root_x, e->root_x - cursor.x);
+ h = MAX(cursor.y - e->root_y, e->root_y - cursor.y);
outline(scrn->root, x, y, w, h);
break;
case XCB_BUTTON_MASK_3: