summaryrefslogtreecommitdiff
path: root/libdecor
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
parent85ec2642c06f5ec03a0339a638554aa684e80622 (diff)
Update to libdecor ca6e6b68 dated 25-aug-2023
Diffstat (limited to 'libdecor')
-rw-r--r--libdecor/build/fl_libdecor.c8
-rw-r--r--libdecor/src/libdecor.c19
2 files changed, 21 insertions, 6 deletions
diff --git a/libdecor/build/fl_libdecor.c b/libdecor/build/fl_libdecor.c
index 6716bf746..ab6cee5c2 100644
--- a/libdecor/build/fl_libdecor.c
+++ b/libdecor/build/fl_libdecor.c
@@ -1,7 +1,7 @@
//
// Interface with the libdecor library for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2022 by Bill Spitzak and others.
+// Copyright 2022-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -16,12 +16,10 @@
/* Improvements to libdecor.c without modifying libdecor.c itself */
-// this part to support libdecor commit f43652c7 dated 15-jul-2023
#include "xdg-shell-client-protocol.h"
-#ifndef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION
-# define XDG_TOPLEVEL_STATE_SUSPENDED (enum xdg_toplevel_state)9
+#ifdef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION
+# define HAVE_XDG_SHELL_V6 1
#endif
-// end of this part
#define libdecor_frame_set_minimized libdecor_frame_set_minimized_orig
#define libdecor_new libdecor_new_orig
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);