summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorRobert Pluim <rpluim@gmail.com>2018-11-27 09:39:30 +0100
committerRobert Pluim <rpluim@gmail.com>2018-11-27 09:41:59 +0100
commita291f624289bd2009b7fa230d62b5940e0484c83 (patch)
treedf21d9b3189008676d61904c70e572411f72b946 /src/gtkutil.c
parentf0531b8e64250414baf1c0d2dde3fbfc55a748a0 (diff)
downloademacs-a291f624289bd2009b7fa230d62b5940e0484c83.tar.gz
Don't call xwidget functions until GTK has been initialized
Follow up fix to Bug#33294. * src/gtkutil.c: Define xg_gtk_initialized. (xg_initialize): Set it when GTK has finished initializing. * src/gtkutil.h: Declare xg_gtk_initialized. * src/xwidget.c (Fmake_xwidget): Error out if GTK has not been initialized. (xwidget_init_view): Likewise.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 5879ab683ea..9540bd9072b 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -147,6 +147,8 @@ struct xg_frame_tb_info
GtkTextDirection dir;
};
+bool xg_gtk_initialized; /* Used to make sure xwidget calls are possible */
+
static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx);
@@ -5306,6 +5308,8 @@ xg_initialize (void)
#ifdef HAVE_FREETYPE
x_last_font_name = NULL;
#endif
+
+ xg_gtk_initialized = true;
}
#endif /* USE_GTK */