aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2025-04-06 06:48:29 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-07 11:03:30 +0000
commit091aa90f1a726507803108b217f52224904115be (patch)
tree1e109b230fe927af4628cc031eb61fd74b088f6e
parentxkbcommon: require libxkbcommon >= 1.8.0 (diff)
wayland: handle xdg-shell edge constraints
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.
-rw-r--r--wayland.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wayland.c b/wayland.c
index 14d9bed9..b13e801d 100644
--- a/wayland.c
+++ b/wayland.c
@@ -888,6 +888,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
}
#if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG