From cbfde138597e5a3f0693aa4bc7c08a515d1e0f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 25 Jun 2015 17:45:01 +0800 Subject: [PATCH] clients/confine: Toggle maximized state with 'm' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to test warping when pointer confinemen region changes, add key binding to the maximized state without using the mouse. Signed-off-by: Jonas Ã…dahl Reviewed-by: Bryce Harrington --- clients/confine.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/clients/confine.c b/clients/confine.c index d3e65a52..c0d908fb 100644 --- a/clients/confine.c +++ b/clients/confine.c @@ -301,6 +301,10 @@ key_handler(struct window *window, struct input *input, uint32_t time, confine->buffer = NULL; window_schedule_redraw(confine->window); break; + case XKB_KEY_m: + window_set_maximized(confine->window, + !window_is_maximized(window)); + break; } } @@ -379,8 +383,17 @@ resize_handler(struct widget *widget, confine->reset = 1; - if (confine->complex_confine_region_enabled) + if (confine->complex_confine_region_enabled) { confine->complex_confine_region_dirty = true; + + if (confine->pointer_confined) { + calculate_complex_confine_region(confine); + window_update_confine_rectangles( + confine->window, + confine->complex_confine_region, + NUM_COMPLEX_REGION_RECTS); + } + } } static void