summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-05-18 17:03:18 +0200
committerBram Moolenaar <Bram@vim.org>2012-05-18 17:03:18 +0200
commit2969570036e154c440cab5a4f8a2cead22587dd9 (patch)
tree6096b9f46418d91be78c13785198bda9a64aa1de /src/gui.c
parent8a4c136a90574ae1800fd088818f0e3bceaa9f21 (diff)
updated for version 7.3.520v7.3.520
Problem: Gvim starts up slow on Unbuntu 12.04. Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro Matsumoto) Do check $DISPLAY being set.
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui.c b/src/gui.c
index 0219d1cfb9..b216121cfe 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -270,6 +270,12 @@ gui_do_fork()
}
/* Child */
+#ifdef FEAT_GUI_GTK
+ /* Call gtk_init_check() here after fork(). See gui_init_check(). */
+ if (gui_mch_init_check() != OK)
+ exit(1);
+#endif
+
# if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
/*
* Change our process group. On some systems/shells a CTRL-C in the
@@ -430,7 +436,17 @@ gui_init_check()
#ifdef ALWAYS_USE_GUI
result = OK;
#else
+# ifdef FEAT_GUI_GTK
+ /*
+ * Note: Don't call gtk_init_check() before fork, it will be called after
+ * the fork. When calling it before fork, it make vim hang for a while.
+ * See gui_do_fork().
+ * Use a simpler check if the GUI window can probably be opened.
+ */
+ result = gui.dofork ? gui_mch_early_init_check() : gui_mch_init_check();
+# else
result = gui_mch_init_check();
+# endif
#endif
return result;
}