Skip to content

Commit e0f3a32

Browse files
committed
updated for version 7.3.506
Problem: GTK gives an error when selecting a non-existent file. Solution: Add a handler to avoid the error. (Christian Brabandt)
1 parent a3f19c6 commit e0f3a32

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/gui_gtk.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ typedef int GtkWidget;
9090
static void entry_activate_cb(GtkWidget *widget, gpointer data);
9191
static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
9292
static void find_replace_cb(GtkWidget *widget, gpointer data);
93+
static void recent_func_log_func(
94+
const gchar *log_domain,
95+
GLogLevelFlags log_level,
96+
const gchar *message,
97+
gpointer user_data);
9398

9499
#if defined(FEAT_TOOLBAR)
95100
/*
@@ -839,6 +844,8 @@ gui_mch_browse(int saving UNUSED,
839844
GtkWidget *fc;
840845
#endif
841846
char_u dirbuf[MAXPATHL];
847+
guint log_handler;
848+
const gchar *domain = "Gtk";
842849

843850
title = CONVERT_TO_UTF8(title);
844851

@@ -853,6 +860,11 @@ gui_mch_browse(int saving UNUSED,
853860
/* If our pointer is currently hidden, then we should show it. */
854861
gui_mch_mousehide(FALSE);
855862

863+
/* Hack: The GTK file dialog warns when it can't access a new file, this
864+
* makes it shut up. http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
865+
log_handler = g_log_set_handler(domain, G_LOG_LEVEL_WARNING,
866+
recent_func_log_func, NULL);
867+
856868
#ifdef USE_FILE_CHOOSER
857869
/* We create the dialog each time, so that the button text can be "Open"
858870
* or "Save" according to the action. */
@@ -916,6 +928,7 @@ gui_mch_browse(int saving UNUSED,
916928
gtk_widget_show(gui.filedlg);
917929
gtk_main();
918930
#endif
931+
g_log_remove_handler(domain, log_handler);
919932

920933
CONVERT_TO_UTF8_FREE(title);
921934
if (gui.browse_fname == NULL)
@@ -1882,3 +1895,14 @@ ex_helpfind(eap)
18821895
* backwards compatibility anyway. */
18831896
do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
18841897
}
1898+
1899+
static void
1900+
recent_func_log_func(const gchar *log_domain UNUSED,
1901+
GLogLevelFlags log_level UNUSED,
1902+
const gchar *message UNUSED,
1903+
gpointer user_data UNUSED)
1904+
{
1905+
/* We just want to suppress the warnings. */
1906+
/* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
1907+
}
1908+

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ static char *(features[]) =
714714

715715
static int included_patches[] =
716716
{ /* Add new patch number below this line */
717+
/**/
718+
506,
717719
/**/
718720
505,
719721
/**/

0 commit comments

Comments
 (0)