diff options
| author | Robert Pluim | 2018-11-27 09:39:30 +0100 |
|---|---|---|
| committer | Robert Pluim | 2018-11-27 09:41:59 +0100 |
| commit | a291f624289bd2009b7fa230d62b5940e0484c83 (patch) | |
| tree | df21d9b3189008676d61904c70e572411f72b946 /src/xwidget.c | |
| parent | f0531b8e64250414baf1c0d2dde3fbfc55a748a0 (diff) | |
| download | emacs-a291f624289bd2009b7fa230d62b5940e0484c83.tar.gz emacs-a291f624289bd2009b7fa230d62b5940e0484c83.zip | |
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/xwidget.c')
| -rw-r--r-- | src/xwidget.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 | ||