From 2981174b2c9227cbcfaee112e8af173b67f91713 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Sat, 2 Sep 2023 08:20:15 +0200 Subject: [PATCH] foot: add backport patch to fix build for x11 --- ...num-value-XDG_TOPLEVEL_STATE_SUSPEND.patch | 70 +++++++++++++++++++ recipes-support/foot/foot_git.bb | 1 + 2 files changed, 71 insertions(+) create mode 100644 recipes-support/foot/foot/0001-wayland-handle-enum-value-XDG_TOPLEVEL_STATE_SUSPEND.patch diff --git a/recipes-support/foot/foot/0001-wayland-handle-enum-value-XDG_TOPLEVEL_STATE_SUSPEND.patch b/recipes-support/foot/foot/0001-wayland-handle-enum-value-XDG_TOPLEVEL_STATE_SUSPEND.patch new file mode 100644 index 0000000..738a1c7 --- /dev/null +++ b/recipes-support/foot/foot/0001-wayland-handle-enum-value-XDG_TOPLEVEL_STATE_SUSPEND.patch @@ -0,0 +1,70 @@ +From 72bc0acfbd4b002ebf26d65368bb65601452353e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= +Date: Mon, 3 Jul 2023 14:36:03 +0200 +Subject: [PATCH 001/117] wayland: handle enum value + XDG_TOPLEVEL_STATE_SUSPENDED + +Added in wayland-protocols-1.32 +--- + wayland.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/wayland.c b/wayland.c +index 406aba6d..5160240b 100644 +--- a/wayland.c ++++ b/wayland.c +@@ -651,6 +651,7 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel, + bool is_tiled_bottom = false; + bool is_tiled_left = false; + bool is_tiled_right = false; ++ bool is_suspended UNUSED = false; + + #if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG + char state_str[2048]; +@@ -665,29 +666,35 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel, + [XDG_TOPLEVEL_STATE_TILED_RIGHT] = "tiled:right", + [XDG_TOPLEVEL_STATE_TILED_TOP] = "tiled:top", + [XDG_TOPLEVEL_STATE_TILED_BOTTOM] = "tiled:bottom", ++#if defined(XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) /* wayland-protocols >= 1.32 */ ++ [XDG_TOPLEVEL_STATE_SUSPENDED] = "suspended", ++#endif + }; + #endif + + enum xdg_toplevel_state *state; + wl_array_for_each(state, states) { + switch (*state) { +- case XDG_TOPLEVEL_STATE_ACTIVATED: is_activated = true; break; +- case XDG_TOPLEVEL_STATE_FULLSCREEN: is_fullscreen = true; break; + case XDG_TOPLEVEL_STATE_MAXIMIZED: is_maximized = true; break; ++ case XDG_TOPLEVEL_STATE_FULLSCREEN: is_fullscreen = true; break; ++ case XDG_TOPLEVEL_STATE_RESIZING: is_resizing = true; break; ++ case XDG_TOPLEVEL_STATE_ACTIVATED: is_activated = true; break; + case XDG_TOPLEVEL_STATE_TILED_LEFT: is_tiled_left = true; break; + case XDG_TOPLEVEL_STATE_TILED_RIGHT: is_tiled_right = true; break; + case XDG_TOPLEVEL_STATE_TILED_TOP: is_tiled_top = true; break; + case XDG_TOPLEVEL_STATE_TILED_BOTTOM: is_tiled_bottom = true; break; +- case XDG_TOPLEVEL_STATE_RESIZING: is_resizing = true; break; +- } ++ ++#if defined(XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) ++ case XDG_TOPLEVEL_STATE_SUSPENDED: is_suspended = true; break; ++#endif ++ } + + #if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG +- if (*state >= XDG_TOPLEVEL_STATE_MAXIMIZED && +- *state <= XDG_TOPLEVEL_STATE_TILED_BOTTOM) +- { ++ if (*state >= 0 && *state < ALEN(strings)) { + state_chars += snprintf( + &state_str[state_chars], sizeof(state_str) - state_chars, +- "%s, ", strings[*state]); ++ "%s, ", ++ strings[*state] != NULL ? strings[*state] : ""); + } + #endif + } +-- +2.41.0 + diff --git a/recipes-support/foot/foot_git.bb b/recipes-support/foot/foot_git.bb index f99896d..3a1fd23 100644 --- a/recipes-support/foot/foot_git.bb +++ b/recipes-support/foot/foot_git.bb @@ -21,6 +21,7 @@ RRECOMMENDS:${PN} = "ncurses-terminfo xdg-utils" SRC_URI = " \ git://codeberg.org/dnkl/foot.git;protocol=https;branch=releases/1.12 \ file://0001-generate-version.sh-dont-try-to-fetch-version-from-g.patch \ + file://0001-wayland-handle-enum-value-XDG_TOPLEVEL_STATE_SUSPEND.patch \ " S = "${WORKDIR}/git"