diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-05-21 17:57:38 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-05-21 17:57:38 +0200 |
| commit | 19684ae9d499a551a7627764de842877fdffb226 (patch) | |
| tree | dbc76722c430e1c92451e3dbaaea445c3f4d7bbe /libdecor | |
| parent | 7347d6e2f66cac9215ccef72f8e7c565597b77fd (diff) | |
Update bundled libdecor to last upstream version (May 14, 2025)
Diffstat (limited to 'libdecor')
| -rw-r--r-- | libdecor/build/fl_libdecor.c | 5 | ||||
| -rw-r--r-- | libdecor/src/libdecor.c | 52 | ||||
| -rw-r--r-- | libdecor/src/libdecor.h | 4 | ||||
| -rw-r--r-- | libdecor/src/plugins/gtk/libdecor-gtk.c | 1 |
4 files changed, 47 insertions, 15 deletions
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 <dlfcn.h> #include <stdlib.h> 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,11 +397,25 @@ 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, }, }; |
