Skip to content

Commit

Permalink
call Activate to set the form to the top. Drag and drop seems to leav…
Browse files Browse the repository at this point in the history
…e focus on where ever the file is being dragged from that can cause dialogs to be blocked
  • Loading branch information
nstlaurent committed Dec 30, 2023
1 parent b896adf commit b0c020b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions DoomLauncher/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ private void UpdateLocalTabData(ITabView tab)
private async Task HandleAddGameFiles(AddFileType type, string[] files,
ITagData tag = null, FileManagement? overrideManagement = null, bool? overridePullTitlepic = null)
{
Activate();
if (!VerifyAddFiles(type, files))
return;

Expand Down Expand Up @@ -1576,17 +1577,14 @@ private FileAddResults UnmanagedAddCheck(string[] fileNames, string directory)
private FileManagement GetUserSelectedFileManagement()
{
FileManagement fileManagement = AppConfiguration.FileManagement;

if (fileManagement == FileManagement.Prompt)
{
FileManagementSelect select = new FileManagementSelect
{
StartPosition = FormStartPosition.CenterParent
};
Activate();
FileManagementSelect select = new FileManagementSelect();
select.StartPosition = FormStartPosition.CenterParent;
select.ShowDialog(this);
fileManagement = select.GetSelectedFileManagement();
}

return fileManagement;
}

Expand Down Expand Up @@ -1858,8 +1856,7 @@ private async void ctrlView_DragDrop(object sender, DragEventArgs e)
{
ITagData tag = null;
if (m_tabHandler.TabViewForControl(ctrl) is TagTabView tagTabView)
tag = tagTabView.TagDataSource;

tag = tagTabView.TagDataSource;
if (ctrl.DoomLauncherParent != null && ctrl.DoomLauncherParent is IWadTabViewCtrl)
await HandleAddGameFiles(AddFileType.IWad, files);
else
Expand Down

0 comments on commit b0c020b

Please sign in to comment.