To: vim-dev@vim.org Subject: patch 5.4p.6 Fcc: outbox From: Bram Moolenaar ------------ Applies to the GTK GUI version only. I had the problem that the font dialog would appear only after the system was frozen for ten seconds. I managed to work around this by moving the font dialog filter setting to after the gtk_widget_show(). I only noticed this problem with GTK 1.2.3 (with a change that will be in 1.2.4, which avoids messing up event handling). 1.1.16 was OK. Don't know why. Please check that the font dialog works for everyone after this patch. Some more info about the bold font problem: It appears to happen for many fonts, where a "medium" font is used for normal text and a bold font is available. Looks like a bold font with a different character cell size is selected, which doesn't work for Vim. Patch 5.4p.6 Problem: GTK: When starting the font dialog, the system would freeze for ten seconds before the dialog is shown. Happens with GTK 1.2.3, not with 1.1.16. Solution: Move setting the font filter to after the gtk_widget_show() call. Files: src/gui_gtk_x11.c *** ../vim-5.4p/src/gui_gtk_x11.c Mon Jul 19 11:09:06 1999 --- src/gui_gtk_x11.c Tue Jul 20 19:23:58 1999 *************** *** 1436,1448 **** * NOTE about font selection widget: this can easily be backported * to gtk-1.0.x. */ - GtkFontSelectionDialog *fsd = NULL; - if (!gui.fontdlg) { ! # ifdef GTK_HAVE_FEATURES_1_1_4 ! static gchar *spacings[] = {"c", "m", NULL}; ! # endif gui.fontdlg = gtk_font_selection_dialog_new("Font Selection"); fsd = GTK_FONT_SELECTION_DIALOG(gui.fontdlg); --- 1436,1444 ---- * NOTE about font selection widget: this can easily be backported * to gtk-1.0.x. */ if (!gui.fontdlg) { ! GtkFontSelectionDialog *fsd = NULL; gui.fontdlg = gtk_font_selection_dialog_new("Font Selection"); fsd = GTK_FONT_SELECTION_DIALOG(gui.fontdlg); *************** *** 1450,1459 **** gtk_font_selection_dialog_set_font_name(fsd, (char *)p_guifont); # ifdef GTK_HAVE_FEATURES_1_1_4 - gtk_font_selection_dialog_set_filter(fsd, - GTK_FONT_FILTER_BASE, - GTK_FONT_ALL, NULL, NULL, - NULL, NULL, spacings, NULL); gtk_window_set_modal(GTK_WINDOW(gui.fontdlg), TRUE); gtk_window_set_transient_for(GTK_WINDOW(gui.fontdlg), GTK_WINDOW(gui.mainwin)); --- 1446,1451 ---- *************** *** 1472,1477 **** --- 1464,1483 ---- } gtk_window_position(GTK_WINDOW(gui.fontdlg), GTK_WIN_POS_MOUSE); gtk_widget_show(gui.fontdlg); + # ifdef GTK_HAVE_FEATURES_1_1_4 + { + static gchar *spacings[] = {"c", "m", NULL}; + + /* In GTK 1.2.3 this must be after the gtk_widget_show() call, + * otherwise everything is blocked for ten seconds. */ + gtk_font_selection_dialog_set_filter( + GTK_FONT_SELECTION_DIALOG(gui.fontdlg), + GTK_FONT_FILTER_BASE, + GTK_FONT_ALL, NULL, NULL, + NULL, NULL, spacings, NULL); + } + # endif + while (gui.fontdlg && GTK_WIDGET_VISIBLE(gui.fontdlg)) gtk_main_iteration_do(TRUE); -- hundred-and-one symptoms of being an internet addict: 179. You wonder why your household garbage can doesn't have an "empty recycle bin" button. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /