@@ -90,6 +90,11 @@ typedef int GtkWidget;
9090static void entry_activate_cb (GtkWidget * widget , gpointer data );
9191static void entry_changed_cb (GtkWidget * entry , GtkWidget * dialog );
9292static 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+
0 commit comments