1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-02 12:02:30 +01:00

Applied patches from Stanislav Maslovski <stanislav.maslovski@gmail.com> to

fix the 2 problems mentioend below:

- Fixed buggy handling of UTF8 characters in textfields in WINGs.
- Fixed segfault in WPrefs when some font description is missing from the
  configuration file.
This commit is contained in:
dan
2006-04-25 23:52:43 +00:00
parent 4688c9839b
commit bc4de88d8b
3 changed files with 120 additions and 72 deletions

View File

@@ -312,9 +312,14 @@ static char*
getSelectedFont(_Panel *panel, FcChar8 *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,12 +363,13 @@ updateSampleFont(_Panel *panel)
WMMenuItem *item= WMGetPopUpButtonMenuItem(panel->optionP,
WMGetPopUpButtonSelectedItem(panel->optionP));
char *fn= WMGetMenuItemRepresentedObject(item);
WMFont *font= WMCreateFont(WMWidgetScreen(panel->box), fn);
if (font)
{
WMSetTextFieldFont(panel->sampleT, font);
WMReleaseFont(font);
if (fn) {
WMFont *font= WMCreateFont(WMWidgetScreen(panel->box), fn);
if (font) {
WMSetTextFieldFont(panel->sampleT, font);
WMReleaseFont(font);
}
}
}
@@ -451,8 +457,8 @@ selectedFamily(WMWidget *w, void *data)
ofont= (FcChar8*)WMGetMenuItemRepresentedObject(item);
nfont= getSelectedFont(panel, ofont);
wfree(ofont);
if (ofont)
wfree(ofont);
WMSetMenuItemRepresentedObject(item, nfont);
}
updateSampleFont(panel);
@@ -471,7 +477,8 @@ selected(WMWidget *w, void *data)
ofont = (FcChar8*)WMGetMenuItemRepresentedObject(item);
nfont= getSelectedFont(panel, ofont);
wfree(ofont);
if (ofont)
wfree(ofont);
WMSetMenuItemRepresentedObject(item, nfont);