From 3166416e4c1add5c768f8a96377bb3af141eec67 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 13 Jun 2023 07:42:44 +0200 Subject: libdecor: update with upstream source code as of 2023-jun-6 --- libdecor/src/plugins/gtk/libdecor-gtk.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libdecor') diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c index 2d9cdd7d4..77e64f7cd 100644 --- a/libdecor/src/plugins/gtk/libdecor-gtk.c +++ b/libdecor/src/plugins/gtk/libdecor-gtk.c @@ -663,8 +663,10 @@ libdecor_plugin_gtk_frame_free(struct libdecor_plugin *plugin, /* when in SSD mode, frame_gtk->header is not a proper GTK widget */ if (!GTK_IS_WIDGET(frame_gtk->header)) return; gtk_widget_destroy(frame_gtk->header); + frame_gtk->header = NULL; if (!GTK_IS_WIDGET(frame_gtk->window)) return; gtk_widget_destroy(frame_gtk->window); + frame_gtk->window = NULL; free_border_component(&frame_gtk->headerbar); free_border_component(&frame_gtk->shadow); @@ -675,6 +677,7 @@ libdecor_plugin_gtk_frame_free(struct libdecor_plugin *plugin, } free(frame_gtk->title); + frame_gtk->title = NULL; frame_gtk->decoration_type = DECORATION_TYPE_NONE; @@ -889,11 +892,15 @@ ensure_title_bar_surfaces(struct libdecor_frame_gtk *frame_gtk) * after construction. So we just destroy and re-create them. */ /* avoid warning when restoring previously turned off decoration */ - if (GTK_IS_WIDGET(frame_gtk->header)) + if (GTK_IS_WIDGET(frame_gtk->header)) { gtk_widget_destroy(frame_gtk->header); + frame_gtk->header = NULL; + } /* avoid warning when restoring previously turned off decoration */ - if (GTK_IS_WIDGET(frame_gtk->window)) + if (GTK_IS_WIDGET(frame_gtk->window)) { gtk_widget_destroy(frame_gtk->window); + frame_gtk->window = NULL; + } frame_gtk->window = gtk_offscreen_window_new(); frame_gtk->header = gtk_header_bar_new(); @@ -1530,10 +1537,9 @@ libdecor_plugin_gtk_frame_property_changed(struct libdecor_plugin *plugin, if (!streq(frame_gtk->title, new_title)) redraw_needed = true; free(frame_gtk->title); + frame_gtk->title = NULL; if (new_title) frame_gtk->title = strdup(new_title); - else - frame_gtk->title = NULL; if (frame_gtk->capabilities != libdecor_frame_get_capabilities(frame)) { frame_gtk->capabilities = libdecor_frame_get_capabilities(frame); -- cgit v1.2.3