]> git.sesse.net Git - vlc/commitdiff
macosx: Fix font selection when some fonts are disabled
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 25 Jan 2015 15:04:29 +0000 (16:04 +0100)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 25 Jan 2015 15:04:29 +0000 (16:04 +0100)
Usage of selectedFont inside changeFont: is not allowed, and its
not needed as all the necessary work is done in convertFont:.

close #13740

modules/gui/macosx/simple_prefs.m

index d51e1fd7396e0b4f83d22be55b94287638e942d4..66d0c2fb45d198462af789f67010f865f2793005 100644 (file)
@@ -1268,8 +1268,12 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
 
 - (void)changeFont:(id)sender
 {
-    NSFont * font = [sender convertFont:[[NSFontManager sharedFontManager] selectedFont]];
-    [o_osd_font_fld setStringValue:[font fontName]];
+    NSFont *someFont = [NSFont systemFontOfSize:12];
+
+    // converts given font to changes in font panel. Original font is irrelevant
+    NSFont *selectedFont = [sender convertFont:someFont];
+
+    [o_osd_font_fld setStringValue:[selectedFont fontName]];
     [self osdSettingChanged:self];
 }