[MPlayer-cvslog] r38617 - trunk/gui/dialog/preferences.c

ib subversion at mplayerhq.hu
Mon Jun 24 21:16:55 EEST 2024


Author: ib
Date: Mon Jun 24 21:16:54 2024
New Revision: 38617

Log:
Check font name when pressing OK.

Do not load a font if there is no entry or if the entry hasn't changed.

Modified:
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Jun 24 21:16:07 2024	(r38616)
+++ trunk/gui/dialog/preferences.c	Mon Jun 24 21:16:54 2024	(r38617)
@@ -322,6 +322,7 @@ static void on_framedrop_toggled (GtkTog
 static void prButton( GtkButton * button, gpointer user_data )
 {
  static int inform = True;
+ const gchar *prFontName;
 
  (void) button;
 
@@ -373,7 +374,13 @@ static void prButton( GtkButton * button
 
 
         /* 4th page */
-        setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) );
+        prFontName = gtk_entry_get_text(GTK_ENTRY(prEFontName));
+        if (!*prFontName) prFontName = NULL;
+        if (prFontName && (gstrcmp(font_name, prFontName) != 0))
+        {
+          setdup(&font_name, prFontName);
+          mplayer(MPLAYER_LOAD_FONT, 0, 0);
+        }
 #ifdef CONFIG_FREETYPE
         if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,0,0 );
         if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,1,0 );


More information about the MPlayer-cvslog mailing list