comparison src/gui.c @ 3518:7bafe52b6245 v7.3.520

updated for version 7.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.
author Bram Moolenaar <bram@vim.org>
date Fri, 18 May 2012 17:03:18 +0200
parents 7ba2f171cdac
children 81d5f3a3e27f
comparison
equal deleted inserted replaced
3517:20507e1e60e8 3518:7bafe52b6245
268 */ 268 */
269 _exit(0); 269 _exit(0);
270 } 270 }
271 /* Child */ 271 /* Child */
272 272
273 #ifdef FEAT_GUI_GTK
274 /* Call gtk_init_check() here after fork(). See gui_init_check(). */
275 if (gui_mch_init_check() != OK)
276 exit(1);
277 #endif
278
273 # if defined(HAVE_SETSID) || defined(HAVE_SETPGID) 279 # if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
274 /* 280 /*
275 * Change our process group. On some systems/shells a CTRL-C in the 281 * Change our process group. On some systems/shells a CTRL-C in the
276 * shell where Vim was started would otherwise kill gvim! 282 * shell where Vim was started would otherwise kill gvim!
277 */ 283 */
428 gui.prev_wrap = -1; 434 gui.prev_wrap = -1;
429 435
430 #ifdef ALWAYS_USE_GUI 436 #ifdef ALWAYS_USE_GUI
431 result = OK; 437 result = OK;
432 #else 438 #else
439 # ifdef FEAT_GUI_GTK
440 /*
441 * Note: Don't call gtk_init_check() before fork, it will be called after
442 * the fork. When calling it before fork, it make vim hang for a while.
443 * See gui_do_fork().
444 * Use a simpler check if the GUI window can probably be opened.
445 */
446 result = gui.dofork ? gui_mch_early_init_check() : gui_mch_init_check();
447 # else
433 result = gui_mch_init_check(); 448 result = gui_mch_init_check();
449 # endif
434 #endif 450 #endif
435 return result; 451 return result;
436 } 452 }
437 453
438 /* 454 /*