Previously, only the user's WMGLOBAL file would be read to determine the
current WINGs fonts (System Font and Bold System Font) in the Font
Configuration panel.  It is quite possible that this information would
not be in the user's WMGLOBAL file, but instead in the system WMGLOBAL
file.

We instead use the WMDefaultSystemFont and WMBoldDefaultSystemFont
functions to get this information.
---
 WPrefs.app/FontSimple.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/WPrefs.app/FontSimple.c b/WPrefs.app/FontSimple.c
index 2262e58..b545fd1 100644
--- a/WPrefs.app/FontSimple.c
+++ b/WPrefs.app/FontSimple.c
@@ -569,6 +569,9 @@ static void showData(_Panel * panel)
 {
        int i;
        WMMenuItem *item;
+       WMScreen *scr;
+
+       scr = WMWidgetScreen(panel->parent);
 
        for (i = 0; i < WMGetPopUpButtonNumberOfItems(panel->optionP); i++) {
                char *ofont, *font;
@@ -579,19 +582,12 @@ static void showData(_Panel * panel)
                if (ofont)
                        wfree(ofont);
 
-               if (strcmp(fontOptions[i].option, "SystemFont") == 0 ||
-                   strcmp(fontOptions[i].option, "BoldSystemFont") == 0) {
-                       char *path;
-                       WMUserDefaults *defaults;
-
-                       path = wdefaultspathfordomain("WMGLOBAL");
-                       defaults = WMGetDefaultsFromPath(path);
-                       wfree(path);
-                       font = WMGetUDStringForKey(defaults,
-                                                  fontOptions[i].option);
-               } else {
+               if (strcmp(fontOptions[i].option, "SystemFont") == 0)
+                       font = WMGetFontName(WMDefaultSystemFont(scr));
+               else if (strcmp(fontOptions[i].option, "BoldSystemFont") == 0)
+                       font = WMGetFontName(WMDefaultBoldSystemFont(scr));
+               else
                        font = GetStringForKey(fontOptions[i].option);
-               }
                if (font)
                        font = wstrdup(font);
                WMSetMenuItemRepresentedObject(item, font);
-- 
2.7.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to