From 8ac9d9f4c67d128b39c71b8b42c90ff0a4280af0 Mon Sep 17 00:00:00 2001 From: Vadim Yegorov Date: Sat, 1 Jun 2024 10:24:51 +0300 Subject: [PATCH] 1. Mantis#0004047: non-modal dialog opened in background. --- far/changelog | 5 +++++ far/plugapi.cpp | 14 ++++++++++++++ far/vbuild.m4 | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/far/changelog b/far/changelog index c2f4cbd334..91ff8ab2d0 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- +zg 2024-06-01 10:22:55+03:00 - build 6342 + +1. Mantis#0004047: non-modal dialog opened in background. + -------------------------------------------------------------------------------- shmuel 2024-06-01 00:07:40+03:00 - build 6341 diff --git a/far/plugapi.cpp b/far/plugapi.cpp index 889393dc04..245d524952 100644 --- a/far/plugapi.cpp +++ b/far/plugapi.cpp @@ -1006,6 +1006,13 @@ HANDLE WINAPI apiDialogInit(const UUID* PluginId, const UUID* Id, intptr_t X1, i if (FarDialog->InitOK()) { + bool modalInPlace = (Flags & FDLG_NONMODAL) && Global->WindowManager->InModal(); + + if (modalInPlace) + { + Flags &= ~FDLG_NONMODAL; + } + if (Flags & FDLG_NONMODAL) FarDialog->SetCanLoseFocus(TRUE); else @@ -1043,6 +1050,13 @@ HANDLE WINAPI apiDialogInit(const UUID* PluginId, const UUID* Id, intptr_t X1, i FarDialog->Process(); Global->WindowManager->PluginCommit(); } + + if (modalInPlace) + { + apiDialogRun(hDlg); + apiDialogFree(hDlg); + hDlg = INVALID_HANDLE_VALUE; + } } } return hDlg; diff --git a/far/vbuild.m4 b/far/vbuild.m4 index a1d78f9b64..a21ef1c31a 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -6341 +6342