From c5f124169514e709699aedc97108837424af5682 Mon Sep 17 00:00:00 2001
From: Philipp Kerling <pkerling@casix.org>
Date: Fri, 28 Jul 2017 14:11:58 +0200
Subject: [PATCH] desktop-shell: Set surface resizing state during interactive
 resize

xdg_shell requires this information to be shared with the client in
order to conform with the specification.

The code to forward this to the client by way of a configure() event
is already in place and works fine, it was just never being used until
now.

Signed-off-by: Philipp Kerling <pkerling@casix.org>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
---
 desktop-shell/shell.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 4608cf2fa..415da1928 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1635,9 +1635,12 @@ resize_grab_button(struct weston_pointer_grab *grab,
 	struct weston_resize_grab *resize = (struct weston_resize_grab *) grab;
 	struct weston_pointer *pointer = grab->pointer;
 	enum wl_pointer_button_state state = state_w;
+	struct weston_desktop_surface *desktop_surface =
+		resize->base.shsurf->desktop_surface;
 
 	if (pointer->button_count == 0 &&
 	    state == WL_POINTER_BUTTON_STATE_RELEASED) {
+		weston_desktop_surface_set_resizing(desktop_surface, false);
 		shell_grab_end(&resize->base);
 		free(grab);
 	}
@@ -1647,7 +1650,10 @@ static void
 resize_grab_cancel(struct weston_pointer_grab *grab)
 {
 	struct weston_resize_grab *resize = (struct weston_resize_grab *) grab;
+	struct weston_desktop_surface *desktop_surface =
+		resize->base.shsurf->desktop_surface;
 
+	weston_desktop_surface_set_resizing(desktop_surface, false);
 	shell_grab_end(&resize->base);
 	free(grab);
 }
@@ -1731,6 +1737,7 @@ surface_resize(struct shell_surface *shsurf,
 	resize->height = geometry.height;
 
 	shsurf->resize_edges = edges;
+	weston_desktop_surface_set_resizing(shsurf->desktop_surface, true);
 	shell_grab_start(&resize->base, &resize_grab_interface, shsurf,
 			 pointer, edges);
 
-- 
GitLab