diff src/w32fns.c @ 101901:3447d99a0529

(w32_hide_hourglass): Handle case where frame disappeared while hourglass was displayed. (Bug #2193)
author Jason Rumney <jasonr@gnu.org>
date Sun, 08 Feb 2009 15:34:38 +0000
parents dd95cb42c0aa
children f978553ef98f
line wrap: on
line diff
--- a/src/w32fns.c	Sun Feb 08 01:52:26 2009 +0000
+++ b/src/w32fns.c	Sun Feb 08 15:34:38 2009 +0000
@@ -5279,9 +5279,18 @@
     {
       struct frame *f = x_window_to_frame (&one_w32_display_info,
 					   hourglass_hwnd);
-
-      f->output_data.w32->hourglass_p = 0;
-      SetCursor (f->output_data.w32->current_cursor);
+      if (f)
+	f->output_data.w32->hourglass_p = 0;
+      else
+	/* If frame was deleted, restore to selected frame's cursor.  */
+	f = SELECTED_FRAME ();
+
+      if (FRAME_W32_P (f))
+	SetCursor (f->output_data.w32->current_cursor);
+      else
+	/* No cursors on non GUI frames - restore to stock arrow cursor.  */
+	SetCursor (w32_load_cursor (IDC_ARROW));
+
       hourglass_shown_p = 0;
     }
 }