diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-04-18 19:32:47 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-04-18 19:32:47 +0200 |
| commit | e6957fc2f52d75d4de0e91df0729156d9ccfb5b0 (patch) | |
| tree | f7f7174dfd5a571f95314116437cec2cbd61d1a0 /libdecor | |
| parent | 3fc8875756c3ce02b1b45bd0383a0c307c442dde (diff) | |
Allow libdecor package version ≥ 0.2.0 with FLTK_USE_SYSTEM_LIBDECOR
Diffstat (limited to 'libdecor')
| -rw-r--r-- | libdecor/build/fl_libdecor-plugins.c | 25 |
1 files changed, 23 insertions, 2 deletions
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; } |
