[PATCH weston v4 20/20] clients/clickdot: Toggle maximized state with 'm'

Jonas Ådahl jadahl at gmail.com
Tue Nov 17 02:11:06 PST 2015


In order to test wapring when pointer confinemen region changes, add
key binding to the maximized state without using the mouse.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
---
 clients/clickdot.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/clients/clickdot.c b/clients/clickdot.c
index 5054a68..519cc63 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -311,6 +311,9 @@ key_handler(struct window *window, struct input *input, uint32_t time,
 		clickdot->buffer = NULL;
 		window_schedule_redraw(clickdot->window);
 		break;
+	case XKB_KEY_m:
+		window_set_maximized(clickdot->window,
+				     !window_is_maximized(window));
 	}
 }
 
@@ -390,8 +393,17 @@ resize_handler(struct widget *widget,
 
 	clickdot->reset = 1;
 
-	if (clickdot->complex_confine_region_enabled)
+	if (clickdot->complex_confine_region_enabled) {
 		clickdot->complex_confine_region_dirty = true;
+
+		if (clickdot->pointer_confined) {
+			calculate_complex_confine_region(clickdot);
+			window_update_confine_rectangles(
+					clickdot->window,
+					clickdot->complex_confine_region,
+					NUM_COMPLEX_REGION_RECTS);
+		}
+	}
 }
 
 static void
-- 
2.4.3



More information about the wayland-devel mailing list