From afeaf129349d09e21bbbf8c5c486865140aac9d3 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 13 Sep 2025 11:46:22 +0200 Subject: [PATCH] Update bundled libdecor to last upstream version (August 15, 2025) --- documentation/src/bundled-libs.dox | 4 ++-- libdecor/src/plugins/gtk/libdecor-gtk.c | 28 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/documentation/src/bundled-libs.dox b/documentation/src/bundled-libs.dox index aa2a62fdd..b9e425230 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 Sept 7, 2025): +Current versions of bundled libraries (as of Sept 13, 2025): Library Version/git commit Release date FLTK Version -------------------------------------------------------------------------- jpeg jpeg-9f 2024-01-14 1.4.0 nanosvg 7aeda550a8 [1] 2023-12-02 1.4.0 png libpng-1.6.50 2025-07-01 1.5.0 zlib zlib-1.3.1 2024-01-22 1.4.0 - libdecor 42f7a53a [2] 2025-05-14 1.5.0 + libdecor c4540b4a [2] 2025-08-15 1.5.0 -------------------------------------------------------------------------- Previous versions of bundled libraries (FLTK 1.3.x): diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c index 3e799835a..bc5b0fa61 100644 --- a/libdecor/src/plugins/gtk/libdecor-gtk.c +++ b/libdecor/src/plugins/gtk/libdecor-gtk.c @@ -924,6 +924,11 @@ ensure_title_bar_surfaces(struct libdecor_frame_gtk *frame_gtk) frame_gtk->headerbar.opaque = false; ensure_component(frame_gtk, &frame_gtk->headerbar); + if (frame_gtk->shadow.wl_surface) { + wl_subsurface_place_above(frame_gtk->headerbar.wl_subsurface, + frame_gtk->shadow.wl_surface); + } + /* create an offscreen window with a header bar */ /* TODO: This should only be done once at frame consutrction, but then * the window and headerbar would not change style (e.g. backdrop) @@ -1761,6 +1766,8 @@ libdecor_plugin_gtk_frame_get_border_size(struct libdecor_plugin *plugin, int *top, int *bottom) { + struct libdecor_frame_gtk *frame_gtk = + (struct libdecor_frame_gtk *) frame; enum libdecor_window_state window_state; if (configuration) { @@ -1778,17 +1785,22 @@ libdecor_plugin_gtk_frame_get_border_size(struct libdecor_plugin *plugin, if (bottom) *bottom = 0; if (top) { - GtkWidget *header = ((struct libdecor_frame_gtk *)frame)->header; enum decoration_type type = window_state_to_decoration_type(window_state); - /* avoid warnings after decoration has been turned off */ - if (GTK_IS_WIDGET(header) && (type != DECORATION_TYPE_NONE)) { - /* Redraw title bar to ensure size will be up-to-date */ - if (configuration && type == DECORATION_TYPE_TITLE_ONLY) - draw_title_bar((struct libdecor_frame_gtk *) frame); - *top = gtk_widget_get_allocated_height(header); - } else { + switch (type) { + case DECORATION_TYPE_NONE: *top = 0; + break; + case DECORATION_TYPE_ALL: + ensure_border_surfaces(frame_gtk); + //draw_border(frame_gtk); + G_GNUC_FALLTHROUGH; + case DECORATION_TYPE_TITLE_ONLY: + if (!frame_gtk->header) + ensure_title_bar_surfaces(frame_gtk); + gtk_widget_show_all(frame_gtk->window); + gtk_widget_get_preferred_height(frame_gtk->header, NULL, top); + break; } }