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

Jonas Ådahl jadahl at gmail.com
Thu Jun 25 21:37:55 PDT 2015


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

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---

This patch is an addition to the pointer lock series. Its purpose is to
demonstrate the changing of the lock/confine regions without breaking
the active or pending lock.


 clients/clickdot.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/clients/clickdot.c b/clients/clickdot.c
index bf5169e..b77c690 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -309,6 +309,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));
 	}
 }
 
@@ -388,6 +391,14 @@ resize_handler(struct widget *widget,
 
 	clickdot->reset = 1;
 	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.1.4



More information about the wayland-devel mailing list