Skip to content

Commit

Permalink
1. Mantis#0004047: non-modal dialog opened in background.
Browse files Browse the repository at this point in the history
  • Loading branch information
zg0 committed Jun 1, 2024
1 parent 6b266f4 commit 8ac9d9f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 14 additions & 0 deletions far/plugapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6341
6342

0 comments on commit 8ac9d9f

Please sign in to comment.