summaryrefslogtreecommitdiff
path: root/libdecor/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-08-25 13:59:07 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-08-25 15:06:27 +0200
commitafc60b2503e0f2107356c17b2779ae58aa2fe31b (patch)
treeb27c5ca6b355a454e19bc9d474d5aac613555346 /libdecor/src
parent85ec2642c06f5ec03a0339a638554aa684e80622 (diff)
Update to libdecor ca6e6b68 dated 25-aug-2023
Diffstat (limited to 'libdecor/src')
-rw-r--r--libdecor/src/libdecor.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libdecor/src/libdecor.c b/libdecor/src/libdecor.c
index b08488939..6fc184c10 100644
--- a/libdecor/src/libdecor.c
+++ b/libdecor/src/libdecor.c
@@ -42,6 +42,12 @@
#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;
@@ -390,9 +396,11 @@ parse_states(struct wl_array *states)
case XDG_TOPLEVEL_STATE_TILED_BOTTOM:
pending_state |= LIBDECOR_WINDOW_STATE_TILED_BOTTOM;
break;
+#ifdef HAVE_XDG_SHELL_V6
case XDG_TOPLEVEL_STATE_SUSPENDED:
pending_state |= LIBDECOR_WINDOW_STATE_SUSPENDED;
break;
+#endif
default:
break;
}
@@ -434,6 +442,7 @@ xdg_toplevel_close(void *user_data,
frame_priv->iface->close(frame, frame_priv->user_data);
}
+#ifdef HAVE_XDG_SHELL_V6
static void
xdg_toplevel_configure_bounds(void *data,
struct xdg_toplevel *xdg_toplevel,
@@ -448,12 +457,15 @@ xdg_toplevel_wm_capabilities(void *data,
struct wl_array *capabilities)
{
}
+#endif
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_configure,
xdg_toplevel_close,
+#ifdef HAVE_XDG_SHELL_V6
xdg_toplevel_configure_bounds,
xdg_toplevel_wm_capabilities,
+#endif
};
static void
@@ -593,6 +605,11 @@ libdecor_frame_unref(struct libdecor_frame *frame)
struct libdecor *context = frame_priv->context;
struct libdecor_plugin *plugin = context->plugin;
+ if (context->decoration_manager && frame_priv->toplevel_decoration) {
+ zxdg_toplevel_decoration_v1_destroy(frame_priv->toplevel_decoration);
+ frame_priv->toplevel_decoration = NULL;
+ }
+
wl_list_remove(&frame->link);
if (frame_priv->xdg_toplevel)
@@ -1258,7 +1275,7 @@ init_xdg_wm_base(struct libdecor *context,
context->xdg_wm_base = wl_registry_bind(context->wl_registry,
id,
&xdg_wm_base_interface,
- MIN(version,6));
+ MIN(version,XDG_WM_BASE_VER));
xdg_wm_base_add_listener(context->xdg_wm_base,
&xdg_wm_base_listener,
context);