From a95a3a0d30dcedcc94227f09bacace69ccdabafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 14 Jun 2023 17:27:05 +0200 Subject: [PATCH] prefs: Remove titlebar-font preference It has been unused since decorations moved into the frames client. Part-of: --- src/core/prefs.c | 70 ------------------------------------------------ src/meta/prefs.h | 6 ----- 2 files changed, 76 deletions(-) diff --git a/src/core/prefs.c b/src/core/prefs.c index 25eeb14db..f051c04d0 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -48,7 +48,6 @@ * not given a name here, because the purpose of the unified handlers * is that keys should be referred to exactly once. */ -#define KEY_TITLEBAR_FONT "titlebar-font" #define KEY_NUM_WORKSPACES "num-workspaces" #define KEY_WORKSPACE_NAMES "workspace-names" @@ -78,8 +77,6 @@ static guint changed_idle; static GList *listeners = NULL; static GHashTable *settings_schemas; -static gboolean use_system_font = FALSE; -static PangoFontDescription *titlebar_font = NULL; static ClutterModifierType mouse_button_mods = CLUTTER_MOD1_MASK; static MetaKeyCombo overlay_key_combo = { 0, 0, 0 }; static MetaKeyCombo locate_pointer_key_combo = { 0, 0, 0 }; @@ -145,7 +142,6 @@ static void queue_changed (MetaPreference pref); static void maybe_give_disable_workarounds_warning (void); -static gboolean titlebar_handler (GVariant*, gpointer*, gpointer); static gboolean mouse_button_mods_handler (GVariant*, gpointer*, gpointer); static gboolean button_layout_handler (GVariant*, gpointer*, gpointer); static gboolean overlay_key_handler (GVariant*, gpointer*, gpointer); @@ -303,13 +299,6 @@ static MetaBoolPreference preferences_bool[] = }, &raise_on_click, }, - { - { "titlebar-uses-system-font", - SCHEMA_GENERAL, - META_PREF_TITLEBAR_FONT, /* note! shares a pref */ - }, - &use_system_font, - }, { { "dynamic-workspaces", SCHEMA_MUTTER, @@ -414,14 +403,6 @@ static MetaStringPreference preferences_string[] = mouse_button_mods_handler, NULL, }, - { - { KEY_TITLEBAR_FONT, - SCHEMA_GENERAL, - META_PREF_TITLEBAR_FONT, - }, - titlebar_handler, - NULL, - }, { { "button-layout", SCHEMA_GENERAL, @@ -1234,45 +1215,6 @@ meta_prefs_get_cursor_size (void) /* Handlers for string preferences. */ /****************************************************************************/ -static gboolean -titlebar_handler (GVariant *value, - gpointer *result, - gpointer data) -{ - PangoFontDescription *desc; - const gchar *string_value; - - *result = NULL; /* ignored */ - string_value = g_variant_get_string (value, NULL); - desc = pango_font_description_from_string (string_value); - - if (desc == NULL) - { - meta_warning ("Could not parse font description " - "\"%s\" from GSettings key %s", - string_value ? string_value : "(null)", - KEY_TITLEBAR_FONT); - return FALSE; - } - - /* Is the new description the same as the old? */ - if (titlebar_font && - pango_font_description_equal (desc, titlebar_font)) - { - pango_font_description_free (desc); - } - else - { - if (titlebar_font) - pango_font_description_free (titlebar_font); - - titlebar_font = desc; - queue_changed (META_PREF_TITLEBAR_FONT); - } - - return TRUE; -} - static gboolean mouse_button_mods_handler (GVariant *value, gpointer *result, @@ -1621,15 +1563,6 @@ iso_next_group_handler (GVariant *value, return TRUE; } -const PangoFontDescription* -meta_prefs_get_titlebar_font (void) -{ - if (use_system_font) - return NULL; - else - return titlebar_font; -} - int meta_prefs_get_num_workspaces (void) { @@ -1673,9 +1606,6 @@ meta_preference_to_string (MetaPreference pref) case META_PREF_RAISE_ON_CLICK: return "RAISE_ON_CLICK"; - case META_PREF_TITLEBAR_FONT: - return "TITLEBAR_FONT"; - case META_PREF_NUM_WORKSPACES: return "NUM_WORKSPACES"; diff --git a/src/meta/prefs.h b/src/meta/prefs.h index f32fdacf3..f89b0d9e9 100644 --- a/src/meta/prefs.h +++ b/src/meta/prefs.h @@ -43,7 +43,6 @@ * @META_PREF_AUTO_RAISE: auto-raise * @META_PREF_AUTO_RAISE_DELAY: auto-raise delay * @META_PREF_FOCUS_CHANGE_ON_POINTER_REST: focus change on pointer rest - * @META_PREF_TITLEBAR_FONT: title-bar font * @META_PREF_NUM_WORKSPACES: number of workspaces * @META_PREF_DYNAMIC_WORKSPACES: dynamic workspaces * @META_PREF_KEYBINDINGS: keybindings @@ -82,7 +81,6 @@ typedef enum META_PREF_AUTO_RAISE, META_PREF_AUTO_RAISE_DELAY, META_PREF_FOCUS_CHANGE_ON_POINTER_REST, - META_PREF_TITLEBAR_FONT, META_PREF_NUM_WORKSPACES, META_PREF_DYNAMIC_WORKSPACES, META_PREF_KEYBINDINGS, @@ -143,10 +141,6 @@ gboolean meta_prefs_get_attach_modal_dialogs (void); META_EXPORT gboolean meta_prefs_get_raise_on_click (void); -/* returns NULL if GTK default should be used */ -META_EXPORT -const PangoFontDescription* meta_prefs_get_titlebar_font (void); - META_EXPORT int meta_prefs_get_num_workspaces (void);