* 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();
+ result = gui.dofork ? gui_mch_early_init_check(TRUE) : gui_mch_init_check();
# else
result = gui_mch_init_check();
# endif
}
/* These arguments make gnome_program_init() print a message and exit.
- * Must start the GUI for this, otherwise ":gui" will exit later! */
- if (option->flags & ARG_NEEDS_GUI)
+ * Must start the GUI for this, otherwise ":gui" will exit later!
+ * Only when the GUI can start. */
+ if ((option->flags & ARG_NEEDS_GUI)
+ && gui_mch_early_init_check(FALSE) == OK)
gui.starting = TRUE;
if (option->flags & ARG_KEEP)
* Return OK or FAIL.
*/
int
-gui_mch_early_init_check(void)
+gui_mch_early_init_check(int give_message)
{
char_u *p;
if (p == NULL || *p == NUL)
{
gui.dying = TRUE;
- EMSG(_((char *)e_opendisp));
+ if (give_message)
+ EMSG(_((char *)e_opendisp));
return FAIL;
}
return OK;
void gui_mch_set_blinking(long waittime, long on, long off);
void gui_mch_stop_blink(void);
void gui_mch_start_blink(void);
-int gui_mch_early_init_check(void);
+int gui_mch_early_init_check(int give_message);
int gui_mch_init_check(void);
void gui_mch_show_tabline(int showit);
int gui_mch_showing_tabline(void);