mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Fix for several segfaults in dtwm that happen with UTF-8 locale and were caused by unckeked XmeRenderTableGetDefaultFont return value
This commit is contained in:
parent
46a6a58fbd
commit
4c56765da3
2 changed files with 15 additions and 8 deletions
|
@ -1716,7 +1716,6 @@ UpdateGCs(
|
|||
XtGCMask value_mask;
|
||||
XmManagerWidget mw = (XmManagerWidget) XtParent(g);
|
||||
XFontStruct * font;
|
||||
Boolean font_rtn;
|
||||
|
||||
if (!G__DoUpdate (g))
|
||||
return;
|
||||
|
@ -1736,16 +1735,19 @@ UpdateGCs(
|
|||
|
||||
/* Get normal GC.
|
||||
*/
|
||||
font_rtn = XmeRenderTableGetDefaultFont (G_FontList (g), &font);
|
||||
value_mask = GCForeground | GCBackground | GCFont | GCFillStyle;
|
||||
value_mask = GCForeground | GCBackground | GCFillStyle;
|
||||
if (XmeRenderTableGetDefaultFont (G_FontList (g), &font)) {
|
||||
value_mask |= GCFont;
|
||||
values.font = font->fid;
|
||||
}
|
||||
|
||||
if (G_UseEmbossedText (g))
|
||||
values.foreground = WhitePixelOfScreen (XtScreen (g));
|
||||
else
|
||||
values.foreground = G_Foreground (g);
|
||||
values.background = G_Background (g);
|
||||
|
||||
values.fill_style = FillSolid;
|
||||
values.font = font->fid;
|
||||
|
||||
G_NormalGC (g) = XtGetGC ((Widget)mw, value_mask, &values);
|
||||
|
||||
/* Get top shadow GC.
|
||||
|
|
|
@ -1027,8 +1027,13 @@ else if (G_ClockHandGC (g))
|
|||
|
||||
/* Get clock hand GC.
|
||||
*/
|
||||
font_rtn = XmeRenderTableGetDefaultFont (G_FontList (g), &font);
|
||||
value_mask = GCForeground | GCFont | GCFillStyle;
|
||||
|
||||
value_mask = GCForeground | GCFillStyle;
|
||||
|
||||
if (XmeRenderTableGetDefaultFont (G_FontList (g), &font)) {
|
||||
value_mask |= GCFont;
|
||||
values.font = font->fid;
|
||||
}
|
||||
|
||||
if (((G_PixmapForeground (g) == WhitePixelOfScreen (XtScreen (g))) &&
|
||||
(G_PixmapBackground (g) == BlackPixelOfScreen (XtScreen (g)))) ||
|
||||
|
@ -1038,7 +1043,7 @@ if (((G_PixmapForeground (g) == WhitePixelOfScreen (XtScreen (g))) &&
|
|||
else
|
||||
values.foreground = mw->manager.top_shadow_color;
|
||||
values.fill_style = FillSolid;
|
||||
values.font = font->fid;
|
||||
|
||||
|
||||
G_ClockHandGC (g) = XtGetGC ((Widget) mw, value_mask, &values);
|
||||
|
||||
|
|
Loading…
Reference in a new issue