diff --git a/documentation/src/bundled-libs.dox b/documentation/src/bundled-libs.dox index 1316f6a81..fdc6ea0f0 100644 --- a/documentation/src/bundled-libs.dox +++ b/documentation/src/bundled-libs.dox @@ -23,14 +23,14 @@ The nanosvg library is not affected. \section bundled-status Current status \code -Current versions of bundled libraries (as of April 4, 2025): +Current versions of bundled libraries (as of May 21, 2025): Library Version/git commit Release date FLTK Version -------------------------------------------------------------------------- jpeg jpeg-9f 2024-01-14 1.4.0 nanosvg 7aeda550a8 [1] 2023-12-02 1.4.0 png libpng-1.6.44 2024-09-12 1.4.1 zlib zlib-1.3.1 2024-01-22 1.4.0 - libdecor 5974b6d4 [2] 2025-04-03 1.5.0 + libdecor 42f7a53a [2] 2025-05-14 1.5.0 -------------------------------------------------------------------------- Previous versions of bundled libraries (FLTK 1.3.x): diff --git a/libdecor/build/fl_libdecor.c b/libdecor/build/fl_libdecor.c index 4d480061a..c7105bd85 100644 --- a/libdecor/build/fl_libdecor.c +++ b/libdecor/build/fl_libdecor.c @@ -17,11 +17,6 @@ /* Improvements to libdecor.c without modifying libdecor.c itself */ #if ! USE_SYSTEM_LIBDECOR -#include "xdg-shell-client-protocol.h" -#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION -# define HAVE_XDG_SHELL_V6 1 -#endif - #include #include static void *dlopen_corrected(const char *, int); diff --git a/libdecor/src/libdecor.c b/libdecor/src/libdecor.c index 8cef57221..39886c80f 100644 --- a/libdecor/src/libdecor.c +++ b/libdecor/src/libdecor.c @@ -42,12 +42,6 @@ #include "xdg-shell-client-protocol.h" #include "xdg-decoration-client-protocol.h" -#ifdef HAVE_XDG_SHELL_V6 -#define XDG_WM_BASE_VER 6 -#else -#define XDG_WM_BASE_VER 2 -#endif - struct libdecor { int ref_count; @@ -403,10 +397,24 @@ parse_states(struct wl_array *states) case XDG_TOPLEVEL_STATE_RESIZING: pending_state |= LIBDECOR_WINDOW_STATE_RESIZING; break; -#ifdef HAVE_XDG_SHELL_V6 +#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION case XDG_TOPLEVEL_STATE_SUSPENDED: pending_state |= LIBDECOR_WINDOW_STATE_SUSPENDED; break; +#endif +#ifdef XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION + case XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT: + pending_state |= LIBDECOR_WINDOW_STATE_CONSTRAINED_LEFT; + break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT: + pending_state |= LIBDECOR_WINDOW_STATE_CONSTRAINED_RIGHT; + break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_TOP: + pending_state |= LIBDECOR_WINDOW_STATE_CONSTRAINED_TOP; + break; + case XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM: + pending_state |= LIBDECOR_WINDOW_STATE_CONSTRAINED_BOTTOM; + break; #endif default: break; @@ -449,7 +457,7 @@ xdg_toplevel_close(void *user_data, frame_priv->iface->close(frame, frame_priv->user_data); } -#ifdef HAVE_XDG_SHELL_V6 +#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION static void xdg_toplevel_configure_bounds(void *user_data, struct xdg_toplevel *xdg_toplevel, @@ -474,7 +482,9 @@ xdg_toplevel_configure_bounds(void *user_data, frame_priv->iface->bounds(frame, width, height, frame_priv->user_data); } } +#endif +#ifdef XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION static void xdg_toplevel_wm_capabilities(void *user_data, struct xdg_toplevel *xdg_toplevel, @@ -510,8 +520,10 @@ xdg_toplevel_wm_capabilities(void *user_data, static const struct xdg_toplevel_listener xdg_toplevel_listener = { xdg_toplevel_configure, xdg_toplevel_close, -#ifdef HAVE_XDG_SHELL_V6 +#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION xdg_toplevel_configure_bounds, +#endif +#ifdef XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION xdg_toplevel_wm_capabilities, #endif }; @@ -725,6 +737,10 @@ libdecor_frame_set_visibility(struct libdecor_frame *frame, : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE); } + if (frame_priv->content_width <= 0 || + frame_priv->content_height <= 0) + return; + /* enable/disable decorations that are managed by a plugin */ if (frame_has_visible_client_side_decoration(frame)) { /* show client-side decorations */ @@ -1357,10 +1373,26 @@ init_xdg_wm_base(struct libdecor *context, uint32_t id, uint32_t version) { + uint32_t desired_version = 2; + + /* Find the required version for the available features. */ +#ifdef XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION + desired_version = MAX(desired_version, XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION); +#endif +#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION + desired_version = MAX(desired_version, XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION); +#endif +#ifdef XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION + desired_version = MAX(desired_version, XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION); +#endif +#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION + desired_version = MAX(desired_version, XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION); +#endif + context->xdg_wm_base = wl_registry_bind(context->wl_registry, id, &xdg_wm_base_interface, - MIN(version,XDG_WM_BASE_VER)); + MIN(version, desired_version)); xdg_wm_base_add_listener(context->xdg_wm_base, &xdg_wm_base_listener, context); diff --git a/libdecor/src/libdecor.h b/libdecor/src/libdecor.h index 2158829fd..71c9d7660 100644 --- a/libdecor/src/libdecor.h +++ b/libdecor/src/libdecor.h @@ -83,6 +83,10 @@ enum libdecor_window_state { LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 1 << 6, LIBDECOR_WINDOW_STATE_SUSPENDED = 1 << 7, LIBDECOR_WINDOW_STATE_RESIZING = 1 << 8, + LIBDECOR_WINDOW_STATE_CONSTRAINED_LEFT = 1 << 9, + LIBDECOR_WINDOW_STATE_CONSTRAINED_RIGHT = 1 << 10, + LIBDECOR_WINDOW_STATE_CONSTRAINED_TOP = 1 << 11, + LIBDECOR_WINDOW_STATE_CONSTRAINED_BOTTOM = 1 << 12, }; enum libdecor_resize_edge { diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c index 3f2a54473..3e799835a 100644 --- a/libdecor/src/plugins/gtk/libdecor-gtk.c +++ b/libdecor/src/plugins/gtk/libdecor-gtk.c @@ -3010,6 +3010,7 @@ libdecor_plugin_description = { .constructor = libdecor_plugin_new, .conflicting_symbols = { "png_free", + "gdk_get_use_xshm", NULL, }, };