diff src/dialog-msw.c @ 707:a307f9a2021d

[xemacs-hg @ 2001-12-20 05:49:28 by andyp] sync with 21-4-6-windows
author andyp
date Thu, 20 Dec 2001 05:49:48 +0000
parents 685b588e92d8
children 943eaba38521
line wrap: on
line diff
--- a/src/dialog-msw.c	Wed Dec 19 00:40:26 2001 +0000
+++ b/src/dialog-msw.c	Thu Dec 20 05:49:48 2001 +0000
@@ -285,6 +285,13 @@
   return arg;
 }
 
+/* Unwind protection decrements dialog count */
+static Lisp_Object
+dialog_popped_down (Lisp_Object arg)
+{
+  popup_up_p--;
+}
+
 
 #define ALIGN_TEMPLATE					\
 {							\
@@ -434,12 +441,13 @@
 	pMalloc->lpVtbl->Free(pMalloc, pidl);
 	pMalloc->lpVtbl->Release(pMalloc);
 	return ret;
-      } 
+      }
       else if (pd.unknown_fname != 0) {
 	ret = tstr_to_local_file_format (pd.unknown_fname);
 	xfree(pd.unknown_fname);
       }
-      
+      else while (1)
+	signal_quit ();
     }
   else
     signal_error (Qdialog_box_error,
@@ -792,16 +800,21 @@
 mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type,
 				    Lisp_Object keys)
 {
+  int unbind_count = specpdl_depth ();
+  record_unwind_protect (dialog_popped_down, Qnil);
+  popup_up_p++;
+
   if (EQ (type, Qfile))
-    return handle_file_dialog_box (f, keys);
+    return unbind_to (unbind_count, handle_file_dialog_box (f, keys));
   else if (EQ (type, Qdirectory))
-    return handle_directory_dialog_box (f, keys);
+    return unbind_to (unbind_count, handle_directory_dialog_box (f, keys));
   else if (EQ (type, Qquestion))
-    return handle_question_dialog_box (f, keys);
+    return unbind_to (unbind_count, handle_question_dialog_box (f, keys));
   else if (EQ (type, Qprint))
-    return mswindows_handle_print_dialog_box (f, keys);
+    return unbind_to (unbind_count, mswindows_handle_print_dialog_box (f, keys));
   else if (EQ (type, Qpage_setup))
-    return mswindows_handle_page_setup_dialog_box (f, keys);
+    return unbind_to (unbind_count, 
+		      mswindows_handle_page_setup_dialog_box (f, keys));
   else
     signal_error (Qunimplemented, "Dialog box type", type);
   return Qnil;