From 6e1df67e03354ec59af38146a24a86475cb826c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 May 2024 13:24:45 +0530 Subject: [PATCH] Use xdg-shell version 6 This gives us window "suspended" events. Theoretically these could be used to implement glfwWindowIconified() and thereby not render suspended OS windows. However let's wait a bit and see how this stabilizes. There are all sorts of bugs around this currently, for example: https://gitlab.gnome.org/GNOME/mutter/-/issues/3435 https://gitlab.gnome.org/GNOME/mutter/-/issues/3229 https://bugreports.qt.io/browse/QTBUG-124450 --- glfw/wl_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 96744cfd7..bcd66e3c7 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -521,7 +521,9 @@ static void registryHandleGlobal(void* data UNUSED, else if (is(xdg_wm_base)) { _glfw.wl.xdg_wm_base_version = 1; -#ifdef XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION +#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION + _glfw.wl.xdg_wm_base_version = MIN(XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION, (int)version); +#elif defined(XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION) _glfw.wl.xdg_wm_base_version = MIN(XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION, (int)version); #endif _glfw.wl.wmBase = wl_registry_bind(registry, name, &xdg_wm_base_interface, _glfw.wl.xdg_wm_base_version);