From 8ae58f934717056c31e0a2663b82a75a252ecf30 Mon Sep 17 00:00:00 2001 From: Ray Chason Date: Fri, 14 Aug 2026 23:49:21 -0400 Subject: [PATCH] Convert the one line message prompt to Xft --- include/winX.h | 32 ++++++++++++++++++++++++++++++++ win/X11/winX.c | 5 +++++ 2 files changed, 37 insertions(+) diff --git a/include/winX.h b/include/winX.h index 02b993f42..26e2440d0 100644 --- a/include/winX.h +++ b/include/winX.h @@ -558,4 +558,36 @@ extern void X11_set_highlight(Widget, boolean); extern void X11_set_percent(Widget, unsigned, Pixel); extern void X11_blink_labels(void); +/* + * These are for widgets that use the enhanced label services only for text + * rendering; not for percentage bars, underlines and such. They only need + * these services if XFT is in use. + */ +#ifdef USE_XFT +static inline void +X11_wrap_widget_if_Xft(Widget w, int win_type) +{ + X11_wrap_widget(w, win_type); +} + +static inline void +X11_update_label_if_Xft(Widget w) +{ + X11_update_label(w); +} +#else /* !USE_XFT */ +static inline void +X11_wrap_widget_if_Xft(Widget w, int win_type) +{ + nhUse(w); + nhUse(win_type); +} + +static inline void +X11_update_label_if_Xft(Widget w) +{ + nhUse(w); +} +#endif /* ?USE_XFT */ + #endif /* WINX_H */ diff --git a/win/X11/winX.c b/win/X11/winX.c index 86691d15b..5ab8ab587 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -2446,6 +2446,7 @@ X11_yn_function_core( (void) memset(buf2, 'X', 25), buf2[25] = '\0'; /* 25 'X's */ yn_minwidth = (Dimension) XTextWidth(yn_font, buf2, (int) strlen(buf2)); + X11_wrap_widget_if_Xft(yn_label, NHW_MESSAGE); } } @@ -2454,6 +2455,7 @@ X11_yn_function_core( num_args = 0; XtSetArg(args[num_args], XtNlabel, buf); num_args++; XtSetValues(yn_label, args, num_args); + X11_update_label_if_Xft(yn_label); /* for !slow, pop up the prompt+response widget */ if (!appResources.slow) { @@ -2497,6 +2499,7 @@ X11_yn_function_core( num_args = 0; XtSetArg(args[num_args], XtNlabel, " "); num_args++; XtSetValues(yn_label, args, num_args); + X11_update_label_if_Xft(yn_label); input_func = 0; /* keystrokes now belong to the map */ highlight_yn(FALSE); /* disguise yn_label as part of map */ @@ -2620,6 +2623,7 @@ highlight_yn(boolean init) XtSetArg(args[0], XtNforeground, vals.foreground); XtSetArg(args[1], XtNbackground, vals.background); XtSetValues(yn_label, args, TWO); + X11_update_label_if_Xft(yn_label); } } else swap_fg_bg(yn_label); @@ -2687,6 +2691,7 @@ init_standard_windows(void) XtSetArg(args[num_args], nhStr(XtNresizable), True); num_args++; XtSetArg(args[num_args], nhStr(XtNlabel), " "); num_args++; XtSetValues(yn_label, args, num_args); + X11_wrap_widget_if_Xft(yn_label, NHW_MESSAGE); } /*