1
0
Fork 0
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:
Eugene Doudine 2014-02-21 13:34:04 +02:00 committed by Jon Trulson
parent 46a6a58fbd
commit 4c56765da3
2 changed files with 15 additions and 8 deletions

View file

@ -1716,7 +1716,6 @@ UpdateGCs(
XtGCMask value_mask; XtGCMask value_mask;
XmManagerWidget mw = (XmManagerWidget) XtParent(g); XmManagerWidget mw = (XmManagerWidget) XtParent(g);
XFontStruct * font; XFontStruct * font;
Boolean font_rtn;
if (!G__DoUpdate (g)) if (!G__DoUpdate (g))
return; return;
@ -1736,16 +1735,19 @@ UpdateGCs(
/* Get normal GC. /* Get normal GC.
*/ */
font_rtn = XmeRenderTableGetDefaultFont (G_FontList (g), &font); value_mask = GCForeground | GCBackground | GCFillStyle;
value_mask = GCForeground | GCBackground | GCFont | GCFillStyle; if (XmeRenderTableGetDefaultFont (G_FontList (g), &font)) {
value_mask |= GCFont;
values.font = font->fid;
}
if (G_UseEmbossedText (g)) if (G_UseEmbossedText (g))
values.foreground = WhitePixelOfScreen (XtScreen (g)); values.foreground = WhitePixelOfScreen (XtScreen (g));
else else
values.foreground = G_Foreground (g); values.foreground = G_Foreground (g);
values.background = G_Background (g); values.background = G_Background (g);
values.fill_style = FillSolid; values.fill_style = FillSolid;
values.font = font->fid;
G_NormalGC (g) = XtGetGC ((Widget)mw, value_mask, &values); G_NormalGC (g) = XtGetGC ((Widget)mw, value_mask, &values);
/* Get top shadow GC. /* Get top shadow GC.

View file

@ -1027,8 +1027,13 @@ else if (G_ClockHandGC (g))
/* Get clock hand GC. /* 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))) && if (((G_PixmapForeground (g) == WhitePixelOfScreen (XtScreen (g))) &&
(G_PixmapBackground (g) == BlackPixelOfScreen (XtScreen (g)))) || (G_PixmapBackground (g) == BlackPixelOfScreen (XtScreen (g)))) ||
@ -1038,7 +1043,7 @@ if (((G_PixmapForeground (g) == WhitePixelOfScreen (XtScreen (g))) &&
else else
values.foreground = mw->manager.top_shadow_color; values.foreground = mw->manager.top_shadow_color;
values.fill_style = FillSolid; values.fill_style = FillSolid;
values.font = font->fid;
G_ClockHandGC (g) = XtGetGC ((Widget) mw, value_mask, &values); G_ClockHandGC (g) = XtGetGC ((Widget) mw, value_mask, &values);