summaryrefslogtreecommitdiff
path: root/libdecor/build
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-15 09:43:35 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-15 12:21:38 +0100
commit82bd0b66522dbdfcfe6274157bb2eaedd3c8051e (patch)
tree7a2f06f9713cf40cc151dd816f464357c304948b /libdecor/build
parent26f5b38a0113be817d13193387913580b5996d77 (diff)
Have FLTK use libdecor at version > 0.2.2
- it's no longer necessary to take care of the change in the layout of "struct libdecor" between versions ≤ 0.2.2 and > 0.2.2 of libdecor - version > 0.2.2 contains MR131, that is, it defines LIBDECOR_WINDOW_STATE_RESIZING so the hack to emulate it is no longer necessary - CMake option FLTK_USE_SYSTEM_LIBDECOR now requires libdecor version > 0.2.2 to be activated, otherwise the bundled libdecor is used - what will be the libdecor version after 0.2.2 (0.2.3? 0.3.0?) is not known as of today
Diffstat (limited to 'libdecor/build')
-rw-r--r--libdecor/build/fl_libdecor-plugins.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/libdecor/build/fl_libdecor-plugins.c b/libdecor/build/fl_libdecor-plugins.c
index fbf4eb657..1e73d736a 100644
--- a/libdecor/build/fl_libdecor-plugins.c
+++ b/libdecor/build/fl_libdecor-plugins.c
@@ -301,23 +301,6 @@ unsigned char *fl_libdecor_titlebar_buffer(struct libdecor_frame *frame,
}
-// When the libdecor version after 0.2.2 will be released, support of older versions
-// will be removed from FLTK. LIBDECOR_MR131 stuff also will be removed.
-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;
-};
-
struct libdecor { // copied from libdecor.c, for libdecor versions > 0.2.2
int ref_count;
const struct libdecor_interface *iface;
@@ -338,18 +321,9 @@ struct libdecor { // copied from libdecor.c, for libdecor versions > 0.2.2
/* Returns whether surface is a GTK-titlebar created by libdecor-gtk */
bool fl_is_surface_gtk_titlebar(struct wl_surface *surface, struct libdecor *context) {
if (!context || get_plugin_kind(NULL) != GTK3) return false;
- static void *new_symbol = NULL;
- static bool first = true;
- if (first) {
- first = false;
- // new_symbol is NULL for libdecor versions ≤ 0.2.2
- new_symbol = dlsym(RTLD_DEFAULT, "libdecor_frame_get_user_data");
- }
- struct wl_list *frames_addr = (new_symbol ? &context->frames :
- &(((struct libdecor_022*)context)->frames) );
// loop over all decorations created by libdecor-gtk
struct libdecor_frame *frame;
- wl_list_for_each(frame, frames_addr, link) {
+ wl_list_for_each(frame, &context->frames, link) {
struct libdecor_frame_gtk *frame_gtk = (struct libdecor_frame_gtk*)frame;
if (frame_gtk->headerbar.wl_surface == surface) return true;
}