* src/pgtkterm.c (pgtk_term_init):
* src/xterm.c (x_term_init):
Use a bool, not an int that keeps incrementing,
to record whether initialization has occurred.
(cherry picked from commit
a1e4f6a35c70cf265c77b445288f4e0ab6ffc19f)
GdkDisplay *dpy;
struct terminal *terminal;
struct pgtk_display_info *dpyinfo;
- static int x_initialized = 0;
+ static bool x_initialized;
static unsigned x_display_id = 0;
static char *initial_display = NULL;
char *dpy_name;
block_input ();
+ bool was_initialized = x_initialized;
if (!x_initialized)
{
any_help_event_p = false;
#ifdef USE_CAIRO
gui_init_fringe (&pgtk_redisplay_interface);
#endif
-
- ++x_initialized;
+ x_initialized = true;
}
dpy_name = SSDATA (display_name);
char **argv2 = argv;
guint id;
- if (x_initialized++ > 1)
+ if (was_initialized)
{
xg_display_open (dpy_name, &dpy);
}
#endif /* USE_X_TOOLKIT */
-static int x_initialized;
+static bool x_initialized;
/* Test whether two display-name strings agree up to the dot that separates
the screen number from the server number. */
block_input ();
+ bool was_initialized = x_initialized;
if (!x_initialized)
{
x_initialize ();
- ++x_initialized;
+ x_initialized = true;
}
#if defined USE_X_TOOLKIT || defined USE_GTK
char **argv2 = argv;
guint id;
- if (x_initialized++ > 1)
+ if (was_initialized)
{
xg_display_open (SSDATA (display_name), &dpy);
}