summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--documentation/src/bundled-libs.dox4
-rw-r--r--libdecor/build/fl_libdecor.c8
-rw-r--r--libdecor/src/libdecor.c19
3 files changed, 23 insertions, 8 deletions
diff --git a/documentation/src/bundled-libs.dox b/documentation/src/bundled-libs.dox
index 1fcba8109..2de0b680e 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 August 23, 2023):
+Current versions of bundled libraries (as of August 25, 2023):
Library Version/git commit Release date FLTK Version
--------------------------------------------------------------------------
jpeg jpeg-9e 2022-01-16 1.4.0
nanosvg abcd277ea4 [1] 2022-12-22 1.4.0
png libpng-1.6.40 2023-06-21 1.4.0
zlib zlib-1.3 2023-08-18 1.4.0
- libdecor f43652c7 [2] 2023-07-15 1.4.0
+ libdecor ca6e6b68 [2] 2023-08-25 1.4.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 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);