From e6957fc2f52d75d4de0e91df0729156d9ccfb5b0 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 18 Apr 2024 19:32:47 +0200 Subject: =?UTF-8?q?Allow=20libdecor=20package=20version=20=E2=89=A5=200.2.?= =?UTF-8?q?0=20with=20FLTK=5FUSE=5FSYSTEM=5FLIBDECOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libdecor/build/fl_libdecor-plugins.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'libdecor') diff --git a/libdecor/build/fl_libdecor-plugins.c b/libdecor/build/fl_libdecor-plugins.c index 1e73d736a..60f6bf56e 100644 --- a/libdecor/build/fl_libdecor-plugins.c +++ b/libdecor/build/fl_libdecor-plugins.c @@ -317,13 +317,34 @@ struct libdecor { // copied from libdecor.c, for libdecor versions > 0.2.2 struct wl_list frames; }; +struct libdecor_022 { // for libdecor versions ≤ 0.2.2 + int ref_count; + const struct libdecor_interface *iface; + struct libdecor_plugin *plugin; + bool plugin_ready; + struct wl_display *wl_display; + struct wl_registry *wl_registry; + struct xdg_wm_base *xdg_wm_base; + struct zxdg_decoration_manager_v1 *decoration_manager; + struct wl_callback *init_callback; + bool init_done; + bool has_error; + struct wl_list frames; +}; + /* Returns whether surface is a GTK-titlebar created by libdecor-gtk */ -bool fl_is_surface_gtk_titlebar(struct wl_surface *surface, struct libdecor *context) { +bool fl_is_surface_gtk_titlebar(struct wl_surface *surface, struct libdecor *context, + struct wl_display *wl_display) { if (!context || get_plugin_kind(NULL) != GTK3) return false; // loop over all decorations created by libdecor-gtk struct libdecor_frame *frame; - wl_list_for_each(frame, &context->frames, link) { + struct wl_list *frames; + if (context->wl_display == wl_display) frames = &context->frames; + else if (((struct libdecor_022*)context)->wl_display == wl_display) + frames = &(((struct libdecor_022*)context)->frames); + else return false; + wl_list_for_each(frame, frames, link) { struct libdecor_frame_gtk *frame_gtk = (struct libdecor_frame_gtk*)frame; if (frame_gtk->headerbar.wl_surface == surface) return true; } -- cgit v1.2.3