diff options
| author | Eli Zaretskii | 2001-12-06 11:56:53 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-12-06 11:56:53 +0000 |
| commit | c6ea27758c3c7e98dd2b60c7697ad970e9a002a3 (patch) | |
| tree | f6b93d926421e0744f2541280a2656b3c88c4ef8 | |
| parent | 53854552560f3f7be6644f8804b4614e5516841f (diff) | |
| download | emacs-c6ea27758c3c7e98dd2b60c7697ad970e9a002a3.tar.gz emacs-c6ea27758c3c7e98dd2b60c7697ad970e9a002a3.zip | |
(x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the
scroll bars of the frame before deleting the frame itself. If the
frame has a widget, delete the frame with XtDestroyWidget, and do
not call XDestroyWindow before that.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xterm.c | 33 |
2 files changed, 33 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e9efc65e9b7..bc80158cf81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2001-12-06 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 2 | |||
| 3 | * xterm.c (x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the | ||
| 4 | scroll bars of the frame before deleting the frame itself. If the | ||
| 5 | frame has a widget, delete the frame with XtDestroyWidget, and do | ||
| 6 | not call XDestroyWindow before that. | ||
| 7 | |||
| 1 | 2001-12-06 Kim F. Storm <storm@cua.dk> | 8 | 2001-12-06 Kim F. Storm <storm@cua.dk> |
| 2 | 9 | ||
| 3 | * xfns.c (x_report_frame_params): Return actual fringe widths. | 10 | * xfns.c (x_report_frame_params): Return actual fringe widths. |
diff --git a/src/xterm.c b/src/xterm.c index db255f07659..51b94c9fb37 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -13219,6 +13219,8 @@ x_free_frame_resources (f) | |||
| 13219 | struct frame *f; | 13219 | struct frame *f; |
| 13220 | { | 13220 | { |
| 13221 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 13221 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 13222 | Lisp_Object bar; | ||
| 13223 | struct scroll_bar *b; | ||
| 13222 | 13224 | ||
| 13223 | BLOCK_INPUT; | 13225 | BLOCK_INPUT; |
| 13224 | 13226 | ||
| @@ -13228,23 +13230,40 @@ x_free_frame_resources (f) | |||
| 13228 | { | 13230 | { |
| 13229 | if (f->output_data.x->icon_desc) | 13231 | if (f->output_data.x->icon_desc) |
| 13230 | XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); | 13232 | XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); |
| 13231 | 13233 | ||
| 13234 | #ifdef USE_X_TOOLKIT | ||
| 13235 | /* Explicitly destroy the scroll bars of the frame. Without | ||
| 13236 | this, we get "BadDrawable" errors from the toolkit later on, | ||
| 13237 | presumably from expose events generated for the disappearing | ||
| 13238 | toolkit scroll bars. */ | ||
| 13239 | for (bar = FRAME_SCROLL_BARS (f); !NILP (bar); bar = b->next) | ||
| 13240 | { | ||
| 13241 | b = XSCROLL_BAR (bar); | ||
| 13242 | x_scroll_bar_remove (b); | ||
| 13243 | } | ||
| 13244 | #endif | ||
| 13245 | |||
| 13232 | #ifdef HAVE_X_I18N | 13246 | #ifdef HAVE_X_I18N |
| 13233 | if (FRAME_XIC (f)) | 13247 | if (FRAME_XIC (f)) |
| 13234 | free_frame_xic (f); | 13248 | free_frame_xic (f); |
| 13235 | #endif | 13249 | #endif |
| 13236 | 13250 | ||
| 13237 | if (FRAME_X_WINDOW (f)) | ||
| 13238 | XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | ||
| 13239 | |||
| 13240 | #ifdef USE_X_TOOLKIT | 13251 | #ifdef USE_X_TOOLKIT |
| 13241 | if (f->output_data.x->widget) | 13252 | if (f->output_data.x->widget) |
| 13242 | { | 13253 | { |
| 13243 | XtDestroyWidget (f->output_data.x->widget); | 13254 | XtDestroyWidget (f->output_data.x->widget); |
| 13244 | f->output_data.x->widget = NULL; | 13255 | f->output_data.x->widget = NULL; |
| 13245 | } | 13256 | } |
| 13257 | /* Tooltips don't have widgets, only a simple X window, even if | ||
| 13258 | we are using a toolkit. */ | ||
| 13259 | else if (FRAME_X_WINDOW (f)) | ||
| 13260 | XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | ||
| 13261 | |||
| 13246 | free_frame_menubar (f); | 13262 | free_frame_menubar (f); |
| 13247 | #endif /* USE_X_TOOLKIT */ | 13263 | #else /* !USE_X_TOOLKIT */ |
| 13264 | if (FRAME_X_WINDOW (f)) | ||
| 13265 | XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | ||
| 13266 | #endif /* !USE_X_TOOLKIT */ | ||
| 13248 | 13267 | ||
| 13249 | unload_color (f, f->output_data.x->foreground_pixel); | 13268 | unload_color (f, f->output_data.x->foreground_pixel); |
| 13250 | unload_color (f, f->output_data.x->background_pixel); | 13269 | unload_color (f, f->output_data.x->background_pixel); |
| @@ -13252,7 +13271,7 @@ x_free_frame_resources (f) | |||
| 13252 | unload_color (f, f->output_data.x->cursor_foreground_pixel); | 13271 | unload_color (f, f->output_data.x->cursor_foreground_pixel); |
| 13253 | unload_color (f, f->output_data.x->border_pixel); | 13272 | unload_color (f, f->output_data.x->border_pixel); |
| 13254 | unload_color (f, f->output_data.x->mouse_pixel); | 13273 | unload_color (f, f->output_data.x->mouse_pixel); |
| 13255 | 13274 | ||
| 13256 | if (f->output_data.x->scroll_bar_background_pixel != -1) | 13275 | if (f->output_data.x->scroll_bar_background_pixel != -1) |
| 13257 | unload_color (f, f->output_data.x->scroll_bar_background_pixel); | 13276 | unload_color (f, f->output_data.x->scroll_bar_background_pixel); |
| 13258 | if (f->output_data.x->scroll_bar_foreground_pixel != -1) | 13277 | if (f->output_data.x->scroll_bar_foreground_pixel != -1) |