changeset 34545:0322014fcf27

(clear_mouse_face): Treat tip_frame as a Lisp_Object. (x_free_frame_resources): New function. (x_destroy_window): Use it.
author Andrew Innes <andrewi@gnu.org>
date Thu, 14 Dec 2000 10:55:10 +0000
parents 24bcec64720c
children 51be06b616bf
files src/w32term.c
diffstat 1 files changed, 36 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Thu Dec 14 10:44:56 2000 +0000
+++ b/src/w32term.c	Thu Dec 14 10:55:10 2000 +0000
@@ -7033,7 +7033,7 @@
 clear_mouse_face (dpyinfo)
      struct w32_display_info *dpyinfo;
 {
-  if (tip_frame)
+  if (!NILP (tip_frame))
     return;
 
   if (! NILP (dpyinfo->mouse_face_window))
@@ -9873,21 +9873,34 @@
   UNBLOCK_INPUT;
 }
 
-/* Destroy the window of frame F.  */
-
-x_destroy_window (f)
+/* Free X resources of frame F.  */
+
+void
+x_free_frame_resources (f)
      struct frame *f;
 {
   struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
 
   BLOCK_INPUT;
 
-  my_destroy_window (f, FRAME_W32_WINDOW (f));
+  if (FRAME_W32_WINDOW (f))
+    my_destroy_window (f, FRAME_W32_WINDOW (f));
+      
   free_frame_menubar (f);
-  free_frame_faces (f);
-
+
+  unload_color (f, f->output_data.x->foreground_pixel);
+  unload_color (f, f->output_data.x->background_pixel);
+  unload_color (f, f->output_data.w32->cursor_pixel);
+  unload_color (f, f->output_data.w32->cursor_foreground_pixel);
+  unload_color (f, f->output_data.w32->border_pixel);
+  unload_color (f, f->output_data.w32->mouse_pixel);
+      
+  if (FRAME_FACE_CACHE (f))
+    free_frame_faces (f);
+      
   xfree (f->output_data.w32);
-  f->output_data.w32 = 0;
+  f->output_data.w32 = NULL;
+  
   if (f == dpyinfo->w32_focus_frame)
     dpyinfo->w32_focus_frame = 0;
   if (f == dpyinfo->w32_focus_event_frame)
@@ -9895,8 +9908,6 @@
   if (f == dpyinfo->w32_highlight_frame)
     dpyinfo->w32_highlight_frame = 0;
 
-  dpyinfo->reference_count--;
-
   if (f == dpyinfo->mouse_face_mouse_frame)
     {
       dpyinfo->mouse_face_beg_row
@@ -9904,10 +9915,25 @@
       dpyinfo->mouse_face_end_row
 	= dpyinfo->mouse_face_end_col = -1;
       dpyinfo->mouse_face_window = Qnil;
+      dpyinfo->mouse_face_deferred_gc = 0;
+      dpyinfo->mouse_face_mouse_frame = 0;
     }
 
   UNBLOCK_INPUT;
 }
+
+
+/* Destroy the window of frame F.  */
+
+x_destroy_window (f)
+     struct frame *f;
+{
+  struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
+
+  x_free_frame_resources (f);
+
+  dpyinfo->reference_count--;
+}
 
 /* Setting window manager hints.  */