From 6ca1bccd1a1828a6afa56e3b8a03dfd0b5253dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sun, 16 Jun 2024 14:51:50 +0200 Subject: [PATCH] clapper-gtk: Ensure private types before template init We need to ensure types that are not part of public API, otherwise GtkBuilder will fail to use them (https://gitlab.gnome.org/GNOME/gtk/-/blob/e81aad25a19aa8e1ec9b5192ec0a71985a1a434b/gtk/glade/README.glade#L15). --- src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c | 4 ++++ src/lib/clapper-gtk/clapper-gtk-video.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c index 4c1d7a94..16bd1d98 100644 --- a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c +++ b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c @@ -30,6 +30,7 @@ #include #include "clapper-gtk-extra-menu-button.h" +#include "clapper-gtk-stream-check-button-private.h" #include "clapper-gtk-utils-private.h" #define PERCENTAGE_ROUND(a) (round ((gdouble) a / 0.01) * 0.01) @@ -453,6 +454,9 @@ clapper_gtk_extra_menu_button_init (ClapperGtkExtraMenuButton *self) { "open-subtitle-stream", open_subtitle_stream, NULL, NULL, NULL }, }; + /* Ensure private types */ + g_type_ensure (CLAPPER_GTK_TYPE_STREAM_CHECK_BUTTON); + gtk_widget_init_template (GTK_WIDGET (self)); self->action_group = g_simple_action_group_new (); diff --git a/src/lib/clapper-gtk/clapper-gtk-video.c b/src/lib/clapper-gtk/clapper-gtk-video.c index a5322baf..ebe264db 100644 --- a/src/lib/clapper-gtk/clapper-gtk-video.c +++ b/src/lib/clapper-gtk/clapper-gtk-video.c @@ -1384,6 +1384,10 @@ clapper_gtk_video_init (ClapperGtkVideo *self) self->touch_fade_delay = DEFAULT_TOUCH_FADE_DELAY; self->auto_inhibit = DEFAULT_AUTO_INHIBIT; + /* Ensure private types */ + g_type_ensure (CLAPPER_GTK_TYPE_STATUS); + g_type_ensure (CLAPPER_GTK_TYPE_BUFFERING_ANIMATION); + gtk_widget_init_template (GTK_WIDGET (self)); gtk_gesture_group (self->touch_gesture, self->click_gesture);