Package: wmaker
Version: 0.92.0-5
Followup-For: Bug #279862

The patch I sent before was somewhat too strightforward, it simply
prevented segfaults from happening, but did not actually allow to set
a font for an item that was missing in the default config.
This limitation is imposed by the upstream's code that assumes
that at least system-wide config files are always up-to-date
and match the source (maintainer, be aware of that!).
The default config provided by the package maintainer
differs from the upstream's config and
misses a setting line for LargeDesktopFont.

The maintainer could not reproduce this bug because he, probably,
never tried to run wmaker in a clean environment,
with yet no user settings stored locally.

The new patch adds simple functionality to cope with
the situation when the default config is broken. It should be the
same resistant to NULLed pointers as the first one.
The patch file is attached.

Use this newer patch instead of the previous one. The patch for the
default config file is also attached.

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.30
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages wmaker depends on:
ii  cpp                   4:3.3.5-3          The GNU C preprocessor (cpp)
ii  debianutils           2.8.4              Miscellaneous utilities specific t
ii  libc6                 2.3.2.ds1-22       GNU C Library: Shared libraries an
ii  libfontconfig1        2.3.1-2            generic font configuration library
ii  libfreetype6          2.1.7-2.4          FreeType 2 font engine, shared lib
ii  libwraster3           0.92.0-5           Shared libraries of Window Maker r
ii  libx11-6              6.8.2.dfsg.1-7bpo1 X Window System protocol client li
ii  libxext6              6.8.2.dfsg.1-7bpo1 X Window System miscellaneous exte
ii  libxft2               2.1.7-1            FreeType-based font drawing librar
ii  libxinerama1          6.8.2.dfsg.1-7bpo1 X Window System multi-head display
ii  libxrender1           1:0.9.0-1bpo1      X Rendering Extension client libra
ii  xlibs                 6.8.2.dfsg.1-7bpo1 X Window System client libraries m
ii  zlib1g                1:1.2.2-4.sarge.2  compression library - runtime

-- no debconf information
--- wmaker-0.92.0.orig/WPrefs.app/FontSimple.c	2004-10-26 15:03:42.000000000 +0300
+++ wmaker-0.92.0/WPrefs.app/FontSimple.c	2005-10-09 00:59:01.000000000 +0300
@@ -312,9 +312,14 @@
 getSelectedFont(_Panel *panel, char *curfont)
 {
     WMListItem *item;
-    FcPattern *pat= FcNameParse(curfont);
+    FcPattern *pat;
     char *name;
-    
+
+    if (curfont)
+        pat = FcNameParse(curfont);
+    else
+        pat = FcPatternCreate();
+
     item= WMGetListSelectedItem(panel->familyL);
     if (item)
     {
@@ -358,18 +363,19 @@
     WMMenuItem *item= WMGetPopUpButtonMenuItem(panel->optionP,
                                            WMGetPopUpButtonSelectedItem(panel->optionP));
     char *fn= WMGetMenuItemRepresentedObject(item);
-    WMFont *font= WMCreateFont(WMWidgetScreen(panel->box), fn);
-
-    if (font)
+    if (fn)
     {
-        WMSetTextFieldFont(panel->sampleT, font);
-        WMReleaseFont(font);
+        WMFont *font= WMCreateFont(WMWidgetScreen(panel->box), fn);
+        if (font)
+        {
+            WMSetTextFieldFont(panel->sampleT, font);
+            WMReleaseFont(font);
+        }
     }
 }
 
 
 
-
 static void
 selectedFamily(WMWidget *w, void *data)
 {
@@ -449,9 +455,9 @@
             char *ofont, *nfont;
 
             ofont= (char*)WMGetMenuItemRepresentedObject(item);
-            
             nfont= getSelectedFont(panel, ofont);
-            free(ofont);
+            if (ofont)
+              free(ofont);
             WMSetMenuItemRepresentedObject(item, nfont);
         }
         updateSampleFont(panel);
@@ -468,9 +474,9 @@
     char *ofont, *nfont;
 
     ofont= (char*)WMGetMenuItemRepresentedObject(item);
-    
     nfont= getSelectedFont(panel, ofont);
-    free(ofont);
+    if (ofont)
+      free(ofont);
     WMSetMenuItemRepresentedObject(item, nfont);
 
     updateSampleFont(panel);
--- wmaker-0.92.0.orig/debian/WindowMaker.default       2005-10-08 
22:18:15.000000000 +0300
+++ wmaker-0.92.0/debian/WindowMaker.default    2005-10-08 23:45:03.000000000 
+0300
@@ -111,6 +111,7 @@
   IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*";
   ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*";
   DisplayFont = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*";
+  LargeDisplayFont = "-*-helvetica-medium-r-normal-*-24-*-*-*-*-*-*-*";
   HighlightColor = white;
   HighlightTextColor = black;
   ClipTitleColor = black;

Reply via email to