Skip to content

@mattn /fix-gui-gtk-fork-issue.diff
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
diff -r 273fbf501965 src/gui.c
--- a/src/gui.c Mon Apr 30 21:09:43 2012 +0200
+++ b/src/gui.c Tue May 01 19:32:14 2012 +0900
@@ -270,6 +270,12 @@
}
/* Child */
+#ifdef FEAT_GUI_GTK
+ /* Call gtk_init_check() here. 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,16 @@
#ifdef ALWAYS_USE_GUI
result = OK;
#else
+# ifdef FEAT_GUI_GTK
+ /*
+ * Note: Don't call gtk_init(), gtk_init_check() before fork.
+ * This will be called after the fork. When calling that before fork,
+ * it make vim hang for a while. See gui_do_fork().
+ */
+ result = gui.dofork ? OK : gui_mch_init_check();
+# else
result = gui_mch_init_check();
+# endif
#endif
return result;
}
@jingzhe

should be:

#ifdef FEAT_GUI_GTK
      /* Call gtk_init_check() here. See gui_init_check(). */
      if (gui_mch_init_check() != OK)
       exit(1);
#endif
@mattn
Owner

What do you mean?

@jingzhe

I mean we should use "#ifdef FEAT_GUI_GTK", but not use "#ifndef" in child process.

I tested your patch in Ubuntu 12.04, if change "#ifndef" -> "#ifdef", then everything is Ok.

@mattn
Owner

Ah, I noticed it just now. hehehe.
Thanks for your notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.