diff options
| author | Glenn Morris | 2018-11-28 07:51:12 -0800 |
|---|---|---|
| committer | Glenn Morris | 2018-11-28 07:51:12 -0800 |
| commit | 415ef4a2b02dac17bf1bb962154633e671e561dd (patch) | |
| tree | 029c1022ff672e6e4e4a2d44a8661a6543b130e5 /src | |
| parent | 2c59cfa831f133ca75b513e05aaedeccfe410784 (diff) | |
| parent | 74a3a795afbf092d4086e5ebb4dcf0254e7c8b46 (diff) | |
| download | emacs-415ef4a2b02dac17bf1bb962154633e671e561dd.tar.gz emacs-415ef4a2b02dac17bf1bb962154633e671e561dd.zip | |
Merge from origin/emacs-26
74a3a79 (origin/emacs-26) Fix a typo in a doc string
911766d Minor markup fix in frames.texi
19ed1e9 * lisp/net/trampver.el (customize-package-emacs-version-alist...
d7132ad * lisp/mh-e/mh-e.el (customize-package-emacs-version-alist): ...
5f39260 * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Pass format to m...
a291f62 Don't call xwidget functions until GTK has been initialized
f0531b8 Improve documentation of Ediff wordwise commands
2925ce5 Support Hunspell 1.7.0 in ispell.el
03bb7a8 Avoid clearing echo-area message by auto-save-visited-file-name
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 da4a0ae13df..382039c4047 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 | ||
| @@ -5321,6 +5323,8 @@ xg_initialize (void) | |||
| 5321 | #ifdef HAVE_FREETYPE | 5323 | #ifdef HAVE_FREETYPE |
| 5322 | x_last_font_name = NULL; | 5324 | x_last_font_name = NULL; |
| 5323 | #endif | 5325 | #endif |
| 5326 | |||
| 5327 | xg_gtk_initialized = true; | ||
| 5324 | } | 5328 | } |
| 5325 | 5329 | ||
| 5326 | #endif /* USE_GTK */ | 5330 | #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 6faac107518..6da7a0bb3f4 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_FIXNAT (width); | 84 | CHECK_FIXNAT (width); |
| 83 | CHECK_FIXNAT (height); | 85 | CHECK_FIXNAT (height); |
| @@ -513,6 +515,10 @@ xwidget_init_view (struct xwidget *xww, | |||
| 513 | struct glyph_string *s, | 515 | struct glyph_string *s, |
| 514 | int x, int y) | 516 | int x, int y) |
| 515 | { | 517 | { |
| 518 | |||
| 519 | if (!xg_gtk_initialized) | ||
| 520 | error ("xwidget_init_view: GTK has not been initialized"); | ||
| 521 | |||
| 516 | struct xwidget_view *xv = allocate_xwidget_view (); | 522 | struct xwidget_view *xv = allocate_xwidget_view (); |
| 517 | Lisp_Object val; | 523 | Lisp_Object val; |
| 518 | 524 | ||