From ba6f3859e02ec8ff4b2d7ba179efa1ee3fb0243c Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Fri, 10 Jun 2005 23:03:28 +0000 Subject: [PATCH] (Fx_file_dialog): Unblock input before falling back to minibuffer. --- src/macfns.c | 3 ++- src/w32fns.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/macfns.c b/src/macfns.c index d0dd9b9c072..b26baf3eaf7 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4375,14 +4375,15 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) break; } NavDialogDispose(dialogRef); + UNBLOCK_INPUT; } else { + UNBLOCK_INPUT; /* Fall back on minibuffer if there was a problem */ file = Fcompleting_read (prompt, intern ("read-file-name-internal"), dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); } - UNBLOCK_INPUT; } UNGCPRO; diff --git a/src/w32fns.c b/src/w32fns.c index 23297ade5f3..0e9e4509373 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7808,6 +7808,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) { OPENFILENAME file_details; + BOOL file_opened = FALSE; /* Prevent redisplay. */ specbind (Qinhibit_redisplay, Qt); @@ -7836,7 +7837,11 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; - if (GetOpenFileName (&file_details)) + file_opened = GetOpenFileName (&file_details); + + UNBLOCK_INPUT; + + if (file_opened) { dostounix_filename (filename); if (file_details.nFilterIndex == 2) @@ -7857,7 +7862,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); - UNBLOCK_INPUT; file = unbind_to (count, file); } -- 2.39.5