[PATCH:xfontsel] When font fails to load, grey out text instead of unmapping text widget

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jan 19 18:28:38 PST 2013


Before if you selected a pattern that couldn't load, such as a strange
encoding, the text widget would simply stop updating, giving the user
no feedback that they weren't seeing the selected font, and leaving
repaint turds from menus in the text area.   Now we are more clear that
something is wrong, and clean up when menus overlap the text.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xfontsel.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xfontsel.c b/xfontsel.c
index 13fb950..c9aa68b 100644
--- a/xfontsel.c
+++ b/xfontsel.c
@@ -1112,7 +1112,7 @@ void SetCurrentFont(XtPointer closure)
 	XFontStruct *font = XLoadQueryFont(dpy, currentFontNameString);
 	String sample_text;
 	if (font == NULL)
-	    XtUnmapWidget(mapWidget);
+	    XtSetSensitive(mapWidget, False);
 	else {
 	    int nargs = 1;
 	    Arg args[3];
@@ -1137,6 +1137,7 @@ void SetCurrentFont(XtPointer closure)
 		nargs = 3;
 	    }
 	    XtSetValues( sampleText, args, nargs );
+	    XtSetSensitive(mapWidget, True);
 	    XtMapWidget(mapWidget);
 	    if (sampleFont) XFreeFont( dpy, sampleFont );
 	    sampleFont = font;
-- 
1.7.9.2



More information about the xorg-devel mailing list