aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xmenu.c23
2 files changed, 24 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 92a05505d91..476f68e142b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-04-11 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xmenu.c (apply_systemfont_to_dialog): New.
4 (create_and_show_dialog): Call apply_systemfont_to_dialog if HAVE_XFT.
5
12010-04-11 Stefan Monnier <monnier@iro.umontreal.ca> 62010-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * process.c (exec_sentinel): Preserve current-buffer. 8 * process.c (exec_sentinel): Preserve current-buffer.
diff --git a/src/xmenu.c b/src/xmenu.c
index de2f4eb6815..c8067a47deb 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -954,6 +954,19 @@ update_frame_menubar (f)
954 954
955#ifdef USE_LUCID 955#ifdef USE_LUCID
956static void 956static void
957apply_systemfont_to_dialog (w)
958 Widget w;
959{
960 const char *fn = xsettings_get_system_normal_font ();
961 if (fn)
962 {
963 XrmDatabase db = XtDatabase (XtDisplay (w));
964 if (db)
965 XrmPutStringResource (&db, "*dialog.faceName", fn);
966 }
967}
968
969static void
957apply_systemfont_to_menu (w) 970apply_systemfont_to_menu (w)
958 Widget w; 971 Widget w;
959{ 972{
@@ -964,15 +977,15 @@ apply_systemfont_to_menu (w)
964 977
965 if (XtIsShell (w)) /* popup menu */ 978 if (XtIsShell (w)) /* popup menu */
966 { 979 {
967 Widget *childs[1]; 980 Widget *childs = NULL;
968 int num = 0; 981 int num = 0;
969 982
970 XtVaGetValues (w, XtNnumChildren, &num, NULL); 983 XtVaGetValues (w, XtNnumChildren, &num, NULL);
971 if (num != 1) return; /* Should only be one. */ 984 if (num != 1) return; /* Should only be one. */
972 985
973 childs[0] = 0; 986 childs[0] = 0;
974 XtVaGetValues (w, XtNchildren, childs, NULL); 987 XtVaGetValues (w, XtNchildren, &childs, NULL);
975 if (childs[0] && *childs[0]) w = *childs[0]; 988 if (childs && *childs) w = *childs;
976 } 989 }
977 990
978 /* Only use system font if the default is used for the menu. */ 991 /* Only use system font if the default is used for the menu. */
@@ -2047,11 +2060,13 @@ create_and_show_dialog (f, first_wv)
2047 abort(); 2060 abort();
2048 2061
2049 dialog_id = widget_id_tick++; 2062 dialog_id = widget_id_tick++;
2063#ifdef HAVE_XFT
2064 apply_systemfont_to_dialog (f->output_data.x->widget);
2065#endif
2050 lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, 2066 lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
2051 f->output_data.x->widget, 1, 0, 2067 f->output_data.x->widget, 1, 0,
2052 dialog_selection_callback, 0, 0); 2068 dialog_selection_callback, 0, 0);
2053 lw_modify_all_widgets (dialog_id, first_wv->contents, True); 2069 lw_modify_all_widgets (dialog_id, first_wv->contents, True);
2054
2055 /* Display the dialog box. */ 2070 /* Display the dialog box. */
2056 lw_pop_up_all_widgets (dialog_id); 2071 lw_pop_up_all_widgets (dialog_id);
2057 popup_activated_flag = 1; 2072 popup_activated_flag = 1;