[PATCH weston 2/2 v2] shell: Add resize-from-center binding

Scott Moreau oreaus at gmail.com
Mon Feb 11 12:32:22 PST 2013


Each binding is a specific key combination which means 'mod+button' is not the
same as 'mod|shift+button'. The new resize functionality detects shift button
state to toggle modes during the resize grab. However, attempting to initiate
a grab with mod|shift+button fails (when not clicking a grabbable edge) because
there is no key binding for this combination. Here we install another binding
for the resize function so resize can be initiated with either binding
combination.
---
 src/shell.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/shell.c b/src/shell.c
index a5fc83a..1ef1af8 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3985,6 +3985,8 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
 					     shell);
 	weston_compositor_add_button_binding(ec, BTN_MIDDLE, mod,
 					     resize_binding, shell);
+	weston_compositor_add_button_binding(ec, BTN_MIDDLE, mod | MODIFIER_SHIFT,
+					     resize_binding, shell);
 	weston_compositor_add_button_binding(ec, BTN_RIGHT, mod,
 					     rotate_binding, NULL);
 	weston_compositor_add_key_binding(ec, KEY_TAB, mod, switcher_binding,
-- 
1.7.10.4



More information about the wayland-devel mailing list