From 685dbf9bbc19c8f4628171c3b301d03ce4c6be87 Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Fri, 15 May 2026 22:47:24 +0200 Subject: [PATCH] fontsel: remove unused selection timeout helpers --- gtk/gtkfontsel.c | 91 ------------------------------------------------ 1 file changed, 91 deletions(-) diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index 1094118b6..81daa0fae 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -585,79 +585,6 @@ gtk_font_selection_new (void) return GTK_WIDGET (fontsel); } -static GQuark -font_selection_font_timeout_quark (void) -{ - return g_quark_from_static_string ("gtk-font-selection-font-timeout"); -} - -static GQuark -font_selection_style_timeout_quark (void) -{ - return g_quark_from_static_string ("gtk-font-selection-style-timeout"); -} - -static GQuark -font_selection_size_timeout_quark (void) -{ - return g_quark_from_static_string ("gtk-font-selection-size-timeout"); -} - -static GQuark -font_selection_immediate_quark (void) -{ - return g_quark_from_static_string ("gtk-font-selection-immediate"); -} - -static void -gtk_font_selection_remove_timeout (GtkFontSelection *fontsel, - GQuark quark) -{ - guint timeout_id; - - timeout_id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (fontsel), quark)); - if (timeout_id) - { - g_source_remove (timeout_id); - g_object_set_qdata (G_OBJECT (fontsel), quark, NULL); - } -} - -static gboolean -gtk_font_selection_get_immediate (GtkFontSelection *fontsel) -{ - return GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (fontsel), - font_selection_immediate_quark ())) != 0; -} - -static void -gtk_font_selection_set_immediate (GtkFontSelection *fontsel, - gboolean immediate) -{ - g_object_set_qdata (G_OBJECT (fontsel), - font_selection_immediate_quark (), - GUINT_TO_POINTER (immediate ? 1 : 0)); -} - -static void -gtk_font_selection_schedule_selection (GtkFontSelection *fontsel, - GQuark quark, - GSourceFunc func) -{ - guint timeout_id; - - gtk_font_selection_remove_timeout (fontsel, quark); - - if (gtk_font_selection_get_immediate (fontsel)) - { - func (fontsel); - return; - } - - timeout_id = g_timeout_add (200, func, fontsel); - g_object_set_qdata (G_OBJECT (fontsel), quark, GUINT_TO_POINTER (timeout_id)); -} - static void gtk_font_selection_finalize (GObject *object) { @@ -667,10 +594,6 @@ gtk_font_selection_finalize (GObject *object) fontsel = GTK_FONT_SELECTION (object); - gtk_font_selection_remove_timeout (fontsel, font_selection_font_timeout_quark ()); - gtk_font_selection_remove_timeout (fontsel, font_selection_style_timeout_quark ()); - gtk_font_selection_remove_timeout (fontsel, font_selection_size_timeout_quark ()); - if (fontsel->font) gdk_font_unref (fontsel->font); @@ -709,8 +632,6 @@ gtk_font_selection_reload_fonts (GtkFontSelection *fontsel) PangoFontDescription *desc; desc = gtk_font_selection_get_font_description (fontsel); - gtk_font_selection_set_immediate (fontsel, TRUE); - gtk_font_selection_show_available_fonts (fontsel); gtk_font_selection_show_available_sizes (fontsel, TRUE); gtk_font_selection_show_available_styles (fontsel); @@ -718,8 +639,6 @@ gtk_font_selection_reload_fonts (GtkFontSelection *fontsel) gtk_font_selection_select_font_desc (fontsel, desc, NULL, NULL); gtk_font_selection_scroll_to_selection (fontsel); - gtk_font_selection_set_immediate (fontsel, FALSE); - pango_font_description_free (desc); } } @@ -831,8 +750,6 @@ gtk_font_selection_real_select_font (gpointer data) g_object_unref (family); } - g_object_set_qdata (G_OBJECT (fontsel), font_selection_font_timeout_quark (), NULL); - return FALSE; } @@ -1110,8 +1027,6 @@ gtk_font_selection_real_select_style (gpointer data) gtk_font_selection_show_available_sizes (fontsel, FALSE); gtk_font_selection_select_best_size (fontsel); - g_object_set_qdata (G_OBJECT (fontsel), font_selection_style_timeout_quark (), NULL); - return FALSE; } @@ -1273,8 +1188,6 @@ gtk_font_selection_real_select_size (gpointer data) gtk_font_selection_set_size (fontsel, new_size * PANGO_SCALE); } - g_object_set_qdata (G_OBJECT (fontsel), font_selection_size_timeout_quark (), NULL); - return FALSE; } @@ -1618,8 +1531,6 @@ gtk_font_selection_select_font_desc (GtkFontSelection *fontsel, if (!new_family) return FALSE; - gtk_font_selection_set_immediate (fontsel, TRUE); - if (pfamily) *pfamily = new_family; else @@ -1670,8 +1581,6 @@ gtk_font_selection_select_font_desc (GtkFontSelection *fontsel, gtk_font_selection_set_size (fontsel, pango_font_description_get_size (new_desc)); - gtk_font_selection_set_immediate (fontsel, FALSE); - return TRUE; }