X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fdialog-msw.c;h=954a27a092cd77cbcb0775ba272bbdffdab0215b;hp=5a7eecf4d2f3e601b7fa75f3a5e480a3a757808a;hb=dbf2768f7b146e97e37a27316f70bb313f1acf15;hpb=042cabb13b0419d8aa5cfac9e087d78730d1dbc7 diff --git a/src/dialog-msw.c b/src/dialog-msw.c index 5a7eecf..954a27a 100644 --- a/src/dialog-msw.c +++ b/src/dialog-msw.c @@ -285,6 +285,14 @@ free_dynarr_opaque_ptr (Lisp_Object arg) return arg; } +/* Unwind protection decrements dialog count */ +static Lisp_Object +dialog_popped_down (Lisp_Object arg) +{ + popup_up_p--; + return Qnil; +} + #define ALIGN_TEMPLATE \ { \ @@ -434,12 +442,13 @@ handle_directory_dialog_box (struct frame *f, Lisp_Object keys) 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_type_error (Qdialog_box_error, @@ -791,16 +800,21 @@ static Lisp_Object 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_type_error (Qunimplemented, "Dialog box type", type); return Qnil;