aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-13 20:28:14 +0000
committerGerd Moellmann2000-12-13 20:28:14 +0000
commit19f71add93831ab99c88995b48377ece882c0c77 (patch)
treefce7f2fcedddb7aec708eb0d7833ed07c27291f7 /src
parent6dec8d78730acb615a5c8f30f6dc24da7408dbf9 (diff)
downloademacs-19f71add93831ab99c88995b48377ece882c0c77.tar.gz
emacs-19f71add93831ab99c88995b48377ece882c0c77.zip
(x_free_frame_resources): New function.
(x_destroy_window): Use it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/xterm.c45
2 files changed, 44 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3fdaf7b259c..bb2f8f3f4c4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -7,6 +7,17 @@
7 7
82000-12-13 Gerd Moellmann <gerd@gnu.org> 82000-12-13 Gerd Moellmann <gerd@gnu.org>
9 9
10 * xfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
11 New variables.
12 (unwind_create_frame, unwind_create_tip_frame): New functions.
13 (Fx_create_frame, x_create_tip_frame): Handle errors signaled
14 while a frame is only partially constructed.
15
16 * xterm.h (x_free_frame_resources): Declare.
17
18 * xterm.c (x_free_frame_resources): New function.
19 (x_destroy_window): Use it.
20
10 * dispnew.c (update_window): If do_mouse_tracking is non-nil, 21 * dispnew.c (update_window): If do_mouse_tracking is non-nil,
11 don't interrupt the update for pending input initially, i.e. 22 don't interrupt the update for pending input initially, i.e.
12 update at least some lines. 23 update at least some lines.
diff --git a/src/xterm.c b/src/xterm.c
index ed1a48b86fc..daf2e90ea95 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12406,11 +12406,12 @@ x_iconify_frame (f)
12406 UNBLOCK_INPUT; 12406 UNBLOCK_INPUT;
12407#endif /* not USE_X_TOOLKIT */ 12407#endif /* not USE_X_TOOLKIT */
12408} 12408}
12409
12409 12410
12410/* Destroy the X window of frame F. */ 12411/* Free X resources of frame F. */
12411 12412
12412void 12413void
12413x_destroy_window (f) 12414x_free_frame_resources (f)
12414 struct frame *f; 12415 struct frame *f;
12415{ 12416{
12416 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 12417 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -12419,19 +12420,19 @@ x_destroy_window (f)
12419 12420
12420 /* If a display connection is dead, don't try sending more 12421 /* If a display connection is dead, don't try sending more
12421 commands to the X server. */ 12422 commands to the X server. */
12422 if (dpyinfo->display != 0) 12423 if (dpyinfo->display)
12423 { 12424 {
12424 if (f->output_data.x->icon_desc != 0) 12425 if (f->output_data.x->icon_desc)
12425 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); 12426 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
12427
12426#ifdef HAVE_X_I18N 12428#ifdef HAVE_X_I18N
12427 if (FRAME_XIC (f)) 12429 if (FRAME_XIC (f))
12428 free_frame_xic (f); 12430 free_frame_xic (f);
12429#endif 12431#endif
12432
12430 if (FRAME_X_WINDOW (f)) 12433 if (FRAME_X_WINDOW (f))
12431 { 12434 XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
12432 XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); 12435
12433 FRAME_X_WINDOW (f) = 0;
12434 }
12435#ifdef USE_X_TOOLKIT 12436#ifdef USE_X_TOOLKIT
12436 if (f->output_data.x->widget) 12437 if (f->output_data.x->widget)
12437 XtDestroyWidget (f->output_data.x->widget); 12438 XtDestroyWidget (f->output_data.x->widget);
@@ -12444,6 +12445,7 @@ x_destroy_window (f)
12444 unload_color (f, f->output_data.x->cursor_foreground_pixel); 12445 unload_color (f, f->output_data.x->cursor_foreground_pixel);
12445 unload_color (f, f->output_data.x->border_pixel); 12446 unload_color (f, f->output_data.x->border_pixel);
12446 unload_color (f, f->output_data.x->mouse_pixel); 12447 unload_color (f, f->output_data.x->mouse_pixel);
12448
12447 if (f->output_data.x->scroll_bar_background_pixel != -1) 12449 if (f->output_data.x->scroll_bar_background_pixel != -1)
12448 unload_color (f, f->output_data.x->scroll_bar_background_pixel); 12450 unload_color (f, f->output_data.x->scroll_bar_background_pixel);
12449 if (f->output_data.x->scroll_bar_foreground_pixel != -1) 12451 if (f->output_data.x->scroll_bar_foreground_pixel != -1)
@@ -12453,7 +12455,9 @@ x_destroy_window (f)
12453 if (f->output_data.x->black_relief.allocated_p) 12455 if (f->output_data.x->black_relief.allocated_p)
12454 unload_color (f, f->output_data.x->black_relief.pixel); 12456 unload_color (f, f->output_data.x->black_relief.pixel);
12455 12457
12456 free_frame_faces (f); 12458 if (FRAME_FACE_CACHE (f))
12459 free_frame_faces (f);
12460
12457 x_free_gcs (f); 12461 x_free_gcs (f);
12458 XFlush (FRAME_X_DISPLAY (f)); 12462 XFlush (FRAME_X_DISPLAY (f));
12459 } 12463 }
@@ -12462,7 +12466,8 @@ x_destroy_window (f)
12462 xfree (f->output_data.x->saved_menu_event); 12466 xfree (f->output_data.x->saved_menu_event);
12463 12467
12464 xfree (f->output_data.x); 12468 xfree (f->output_data.x);
12465 f->output_data.x = 0; 12469 f->output_data.x = NULL;
12470
12466 if (f == dpyinfo->x_focus_frame) 12471 if (f == dpyinfo->x_focus_frame)
12467 dpyinfo->x_focus_frame = 0; 12472 dpyinfo->x_focus_frame = 0;
12468 if (f == dpyinfo->x_focus_event_frame) 12473 if (f == dpyinfo->x_focus_event_frame)
@@ -12470,8 +12475,6 @@ x_destroy_window (f)
12470 if (f == dpyinfo->x_highlight_frame) 12475 if (f == dpyinfo->x_highlight_frame)
12471 dpyinfo->x_highlight_frame = 0; 12476 dpyinfo->x_highlight_frame = 0;
12472 12477
12473 dpyinfo->reference_count--;
12474
12475 if (f == dpyinfo->mouse_face_mouse_frame) 12478 if (f == dpyinfo->mouse_face_mouse_frame)
12476 { 12479 {
12477 dpyinfo->mouse_face_beg_row 12480 dpyinfo->mouse_face_beg_row
@@ -12485,6 +12488,24 @@ x_destroy_window (f)
12485 12488
12486 UNBLOCK_INPUT; 12489 UNBLOCK_INPUT;
12487} 12490}
12491
12492
12493/* Destroy the X window of frame F. */
12494
12495void
12496x_destroy_window (f)
12497 struct frame *f;
12498{
12499 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
12500
12501 /* If a display connection is dead, don't try sending more
12502 commands to the X server. */
12503 if (dpyinfo->display != 0)
12504 x_free_frame_resources (f);
12505
12506 dpyinfo->reference_count--;
12507}
12508
12488 12509
12489/* Setting window manager hints. */ 12510/* Setting window manager hints. */
12490 12511