[PATCH weston 2/2] clients: don't discard motion if we have a grab

Luis de Bethencourt luis at debethencourt.com
Thu Aug 27 10:50:38 PDT 2015


On Wed, Aug 26, 2015 at 05:13:27PM -0500, Derek Foreman wrote:
> We discard motion outside the window on the assumption it's from before
> some event that caused the window to shrink. However, if we have a grab
> it's likely that this motion is actually from dragging from the inside
> of the window out.
> 
> This fixes a problem where drag selecting in weston terminal behaves
> oddly - it doesn't update the select region while the drag is happening
> outside the window.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>

Tested-by: Luis de Bethencourt <luisbg at osg.samsung.com>

> ---
>  clients/window.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/clients/window.c b/clients/window.c
> index 52de248..9c20480 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -2746,12 +2746,13 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
>  
>  	/* when making the window smaller - e.g. after a unmaximise we might
>  	 * still have a pending motion event that the compositor has picked
> -	 * based on the old surface dimensions
> +	 * based on the old surface dimensions. However, if we have an active
> +	 * grab, we expect to see input from outside the window anyway.
>  	 */
> -	if (sx < window->main_surface->allocation.x ||
> +	if (!input->grab && (sx < window->main_surface->allocation.x ||
>  	    sy < window->main_surface->allocation.y ||
>  	    sx > window->main_surface->allocation.width ||
> -	    sy > window->main_surface->allocation.height)
> +	    sy > window->main_surface->allocation.height))
>  		return;
>  
>  	if (!(input->grab && input->grab_button)) {
> -- 
> 2.4.6
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list