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

Submitted by Jonas Ådahl on June 26, 2015, 4:37 a.m.

Details

Message ID 1435293482-20979-2-git-send-email-jadahl@gmail.com
State Superseded
Delegated to: Daniel Stone
Headers show

Not browsing as part of any series.

Commit Message

Jonas Ådahl June 26, 2015, 4:37 a.m.
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@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(+)

Patch hide | download patch | download mbox

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

Comments

On Fri, Jun 26, 2015 at 12:37:55PM +0800, Jonas Ådahl wrote:
> 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@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(+)

I presume this patch depends on some other patches to land first, since
pointer_confined isn't yet in the clickdot structure.  But apart from
that detail, this LGTM for landing post-release:

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
 
> 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
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel