From c67f3c50389b2826de6a32fe3809305ce2730392 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jun 2023 06:39:02 -0400 Subject: [PATCH 1/4] Avoid deprecation warnings from GTK_ALIGN_BASELINE_FILL We have to be careful to only use GDK_ALIGN_BASELINE_FILL when permitted by GDK_VERSION_MAX_ALLOWED because gtkenums.h is a public header. Fixes: #5875 I don't think we can avoid conditional compilation here, because the old definition is going to cause deprecated declaration warnings unless you define an old GDK_VERSION_MIN_REQUIRED. --- gtk/gtkenums.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index cac6de6856..9f9f5615b8 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -70,7 +70,7 @@ typedef enum GTK_ALIGN_END, GTK_ALIGN_CENTER, GTK_ALIGN_BASELINE_FILL GDK_AVAILABLE_ENUMERATOR_IN_4_12, - GTK_ALIGN_BASELINE GDK_DEPRECATED_ENUMERATOR_IN_4_12_FOR(GTK_ALIGN_BASELINE_FILL) = GTK_ALIGN_BASELINE_FILL, + GTK_ALIGN_BASELINE GDK_DEPRECATED_ENUMERATOR_IN_4_12_FOR(GTK_ALIGN_BASELINE_FILL) = GTK_ALIGN_CENTER + 1, GTK_ALIGN_BASELINE_CENTER GDK_AVAILABLE_ENUMERATOR_IN_4_12, } GtkAlign; From 53af7208e60569d3a86b99c385b7db0d2f2989f8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jun 2023 08:12:56 -0400 Subject: [PATCH 2/4] gdk: Fix an oversight in GdkContentFormats When clearing a builder, reset the counts to 0. Otherwise valgrind spots uninitialized memory use in our testsuite. --- gdk/gdkcontentformats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/gdkcontentformats.c b/gdk/gdkcontentformats.c index cb2528fbee..9ca4db3205 100644 --- a/gdk/gdkcontentformats.c +++ b/gdk/gdkcontentformats.c @@ -645,6 +645,9 @@ gdk_content_formats_builder_clear (GdkContentFormatsBuilder *builder) { g_clear_pointer (&builder->gtypes, g_slist_free); g_clear_pointer (&builder->mime_types, g_slist_free); + + builder->n_gtypes = 0; + builder->n_mime_types = 0; } /** From 351d7479090038b8dd0e54ccfda03eec5c49434a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jun 2023 08:23:09 -0400 Subject: [PATCH 3/4] print: Drop one use of private api We added public api for the foreground color for just this case, so use it. --- gtk/print/gtkprintunixdialog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtk/print/gtkprintunixdialog.c b/gtk/print/gtkprintunixdialog.c index 36639a3097..f39a361a1a 100644 --- a/gtk/print/gtkprintunixdialog.c +++ b/gtk/print/gtkprintunixdialog.c @@ -2583,8 +2583,7 @@ draw_page (GtkDrawingArea *da, g_object_unref (layout); - style = gtk_css_node_get_style (gtk_widget_get_css_node (widget)); - color = *gtk_css_color_value_get_rgba (style->core->color); + gtk_widget_get_color (widget, &color); if (page_setup != NULL) { From 4c65bdf70738c17c504eb772f8c6a0235654681f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jun 2023 08:28:36 -0400 Subject: [PATCH 4/4] Fix some typos in gtk.supp Actually ignore the media module leak. --- gtk.supp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk.supp b/gtk.supp index b6b315c823..3bdfc02829 100644 --- a/gtk.supp +++ b/gtk.supp @@ -14,7 +14,7 @@ GIO modules Memcheck:Leak match-leak-kinds: definite - fun:malloc + fun:calloc ... fun:_g_io_module_get_default } @@ -23,9 +23,9 @@ GTK media extension gio modules Memcheck:Leak match-leak-kinds: definite - fun:malloc + fun:calloc ... - fun:gio_module_new + fun:g_io_module_new ... fun:gtk_media_file_extension_init }