[PATCH] libweston-desktop: update client state when its size was already set

Arnaud Vrac rawoul at gmail.com
Mon Sep 12 15:22:11 UTC 2016


From: Arnaud Vrac <avrac at freebox.fr>

The shell can request a specific size via a configure event when
toggling fullscreen or maximizing the client. However, if the client
already has the requested size, the client state is not updated,
preventing the switch to fullscreen or maximized states.

Signed-off-by: Arnaud Vrac <avrac at freebox.fr>
---
 libweston-desktop/xdg-shell-v5.c | 4 +++-
 libweston-desktop/xdg-shell-v6.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index 83e5d30..e42d1c4 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -192,7 +192,9 @@ weston_desktop_xdg_surface_set_size(struct weston_desktop_surface *dsurface,
 	struct weston_desktop_xdg_surface *surface = user_data;
 	struct weston_surface *wsurface = weston_desktop_surface_get_surface(surface->surface);
 
-	if (wsurface->width == width && wsurface->height == height)
+	if (wsurface->width == width && wsurface->height == height &&
+	    surface->requested_size.width == width &&
+	    surface->requested_size.height == height)
 		return;
 
 	surface->requested_size.width = width;
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index d4d0112..4828d14 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -607,7 +607,9 @@ weston_desktop_xdg_toplevel_set_size(struct weston_desktop_surface *dsurface,
 	struct weston_surface *wsurface =
 		weston_desktop_surface_get_surface(toplevel->base.desktop_surface);
 
-	if (wsurface->width == width && wsurface->height == height)
+	if (wsurface->width == width && wsurface->height == height &&
+	    toplevel->requested_size.width == width &&
+	    toplevel->requested_size.height == height)
 		return;
 
 	toplevel->requested_size.width = width;
-- 
2.7.4



More information about the wayland-devel mailing list