Update to libdecor ca6e6b68 dated 25-aug-2023

This commit is contained in:
ManoloFLTK
2023-08-25 13:59:07 +02:00
parent 85ec2642c0
commit afc60b2503
3 changed files with 23 additions and 8 deletions

View File

@@ -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

View File

@@ -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);