Mercurial > vim
comparison src/gui_gtk_x11.c @ 9836:bc591685594a v7.4.2193
commit https://github.com/vim/vim/commit/717e196060d946fe20bb0f0307f417dc4d0e9b17
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 10 21:28:44 2016 +0200
patch 7.4.2193
Problem: With Gnome when the GUI can't start test_startup hangs.
Solution: Call gui_mch_early_init_check(). (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 10 Aug 2016 21:30:07 +0200 |
parents | d63b85fe3dc7 |
children | 664276833670 |
comparison
equal
deleted
inserted
replaced
9835:5e15a9ae1039 | 9836:bc591685594a |
---|---|
540 break; | 540 break; |
541 } | 541 } |
542 } | 542 } |
543 | 543 |
544 /* These arguments make gnome_program_init() print a message and exit. | 544 /* These arguments make gnome_program_init() print a message and exit. |
545 * Must start the GUI for this, otherwise ":gui" will exit later! */ | 545 * Must start the GUI for this, otherwise ":gui" will exit later! |
546 if (option->flags & ARG_NEEDS_GUI) | 546 * Only when the GUI can start. */ |
547 if ((option->flags & ARG_NEEDS_GUI) | |
548 && gui_mch_early_init_check(FALSE) == OK) | |
547 gui.starting = TRUE; | 549 gui.starting = TRUE; |
548 | 550 |
549 if (option->flags & ARG_KEEP) | 551 if (option->flags & ARG_KEEP) |
550 ++i; | 552 ++i; |
551 else | 553 else |
1661 * Check if the GUI can be started. Called before gvimrc is sourced and | 1663 * Check if the GUI can be started. Called before gvimrc is sourced and |
1662 * before fork(). | 1664 * before fork(). |
1663 * Return OK or FAIL. | 1665 * Return OK or FAIL. |
1664 */ | 1666 */ |
1665 int | 1667 int |
1666 gui_mch_early_init_check(void) | 1668 gui_mch_early_init_check(int give_message) |
1667 { | 1669 { |
1668 char_u *p; | 1670 char_u *p; |
1669 | 1671 |
1670 /* Guess that when $DISPLAY isn't set the GUI can't start. */ | 1672 /* Guess that when $DISPLAY isn't set the GUI can't start. */ |
1671 p = mch_getenv((char_u *)"DISPLAY"); | 1673 p = mch_getenv((char_u *)"DISPLAY"); |
1672 if (p == NULL || *p == NUL) | 1674 if (p == NULL || *p == NUL) |
1673 { | 1675 { |
1674 gui.dying = TRUE; | 1676 gui.dying = TRUE; |
1675 EMSG(_((char *)e_opendisp)); | 1677 if (give_message) |
1678 EMSG(_((char *)e_opendisp)); | |
1676 return FAIL; | 1679 return FAIL; |
1677 } | 1680 } |
1678 return OK; | 1681 return OK; |
1679 } | 1682 } |
1680 | 1683 |