diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 4 | ||||
| -rw-r--r-- | src/gtkutil.h | 1 | ||||
| -rw-r--r-- | src/xwidget.c | 6 |
3 files changed, 11 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 | |||
| 147 | GtkTextDirection dir; | 147 | GtkTextDirection dir; |
| 148 | }; | 148 | }; |
| 149 | 149 | ||
| 150 | bool xg_gtk_initialized; /* Used to make sure xwidget calls are possible */ | ||
| 151 | |||
| 150 | static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx); | 152 | static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx); |
| 151 | 153 | ||
| 152 | 154 | ||
| @@ -5306,6 +5308,8 @@ xg_initialize (void) | |||
| 5306 | #ifdef HAVE_FREETYPE | 5308 | #ifdef HAVE_FREETYPE |
| 5307 | x_last_font_name = NULL; | 5309 | x_last_font_name = NULL; |
| 5308 | #endif | 5310 | #endif |
| 5311 | |||
| 5312 | xg_gtk_initialized = true; | ||
| 5309 | } | 5313 | } |
| 5310 | 5314 | ||
| 5311 | #endif /* USE_GTK */ | 5315 | #endif /* USE_GTK */ |
diff --git a/src/gtkutil.h b/src/gtkutil.h index 7dcd549f5c0..3b074073e44 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h | |||
| @@ -202,5 +202,6 @@ extern void xg_initialize (void); | |||
| 202 | to indicate that the callback should do nothing. */ | 202 | to indicate that the callback should do nothing. */ |
| 203 | extern bool xg_ignore_gtk_scrollbar; | 203 | extern bool xg_ignore_gtk_scrollbar; |
| 204 | 204 | ||
| 205 | extern bool xg_gtk_initialized; | ||
| 205 | #endif /* USE_GTK */ | 206 | #endif /* USE_GTK */ |
| 206 | #endif /* GTKUTIL_H */ | 207 | #endif /* GTKUTIL_H */ |
diff --git a/src/xwidget.c b/src/xwidget.c index bcc450bac60..09c65d0d3ee 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -78,6 +78,8 @@ Returns the newly constructed xwidget, or nil if construction fails. */) | |||
| 78 | Lisp_Object title, Lisp_Object width, Lisp_Object height, | 78 | Lisp_Object title, Lisp_Object width, Lisp_Object height, |
| 79 | Lisp_Object arguments, Lisp_Object buffer) | 79 | Lisp_Object arguments, Lisp_Object buffer) |
| 80 | { | 80 | { |
| 81 | if (!xg_gtk_initialized) | ||
| 82 | error ("make-xwidget: GTK has not been initialized"); | ||
| 81 | CHECK_SYMBOL (type); | 83 | CHECK_SYMBOL (type); |
| 82 | CHECK_NATNUM (width); | 84 | CHECK_NATNUM (width); |
| 83 | CHECK_NATNUM (height); | 85 | CHECK_NATNUM (height); |
| @@ -508,6 +510,10 @@ xwidget_init_view (struct xwidget *xww, | |||
| 508 | struct glyph_string *s, | 510 | struct glyph_string *s, |
| 509 | int x, int y) | 511 | int x, int y) |
| 510 | { | 512 | { |
| 513 | |||
| 514 | if (!xg_gtk_initialized) | ||
| 515 | error ("xwidget_init_view: GTK has not been initialized"); | ||
| 516 | |||
| 511 | struct xwidget_view *xv = allocate_xwidget_view (); | 517 | struct xwidget_view *xv = allocate_xwidget_view (); |
| 512 | Lisp_Object val; | 518 | Lisp_Object val; |
| 513 | 519 | ||