tInflate/Deflate windows when scrolling - glazier - window management experiments
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit d5edef0ae3bf603796ec60aa9195f9a6abfafcb0
(DIR) parent 911d7cc0d0d8989a8070b8f9e786ddbabdd5ae34
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Sat, 19 Oct 2019 02:15:07 +0200
Inflate/Deflate windows when scrolling
Diffstat:
M config.def.h | 3 +++
M glazier.c | 15 +++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/config.def.h b/config.def.h
t@@ -8,3 +8,6 @@
/* window borders */
int border = 8;
int border_color = 0xdeadca7;
+
+/* move/resize step amound in pixels */
+int move_step = 8;
(DIR) diff --git a/glazier.c b/glazier.c
t@@ -68,6 +68,7 @@ cb_create(xcb_generic_event_t *ev)
static int
cb_mouse_press(xcb_generic_event_t *ev)
{
+ int x, y, w, h;
xcb_cursor_t p;
xcb_cursor_context_t *cx;
xcb_grab_pointer_cookie_t c;
t@@ -94,6 +95,20 @@ cb_mouse_press(xcb_generic_event_t *ev)
case 3:
p = xcb_cursor_load_cursor(cx, XHAIR_SIZE);
break;
+ case 4:
+ x = wm_get_attribute(wid, ATTR_X) - move_step/2;
+ y = wm_get_attribute(wid, ATTR_Y) - move_step/2;
+ w = wm_get_attribute(wid, ATTR_W) + move_step;
+ h = wm_get_attribute(wid, ATTR_H) + move_step;
+ wm_teleport(wid, x, y, w, h);
+ break;
+ case 5:
+ x = wm_get_attribute(wid, ATTR_X) + move_step/2;
+ y = wm_get_attribute(wid, ATTR_Y) + move_step/2;
+ w = wm_get_attribute(wid, ATTR_W) - move_step;
+ h = wm_get_attribute(wid, ATTR_H) - move_step;
+ wm_teleport(wid, x, y, w, h);
+ break;
default:
return 1;
}