From 091aa90f1a726507803108b217f52224904115be Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sun, 6 Apr 2025 15:48:29 +0900 Subject: [PATCH] wayland: handle xdg-shell edge constraints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wayland-protocols commit 86750c99ed06 ("xdg-shell: Add edge constraints") added a few more enums to handle, making the build fail with -Werror: ../wayland.c: In function ‘xdg_toplevel_configure’: ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT’ not handled in switch [-Werror=switch] 878 | switch (*state) { | ^~~~~~ ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT’ not handled in switch [-Werror=switch] ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_TOP’ not handled in switch [-Werror=switch] ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM’ not handled in switch [-Werror=switch] (This is not part of any release yet, but can be used when building with the submodule) From a quick look it sounds like the meaning is the same as tiling as far as we are concerned so handle these as we do of tiling. --- wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wayland.c b/wayland.c index 14d9bed9..b13e801d 100644 --- a/wayland.c +++ b/wayland.c @@ -887,6 +887,12 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel, #if defined(XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) case XDG_TOPLEVEL_STATE_SUSPENDED: is_suspended = true; break; +#endif +#if defined(XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION) + case XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT: is_tiled_left = true; break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT: is_tiled_right = true; break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_TOP: is_tiled_top = true; break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM: is_tiled_bottom = true; break; #endif }