Merge pull request #3862 from Flow-Launcher/dialog_jump_improvement

Fix dialog jump issue when result will not be execueted under empty query option
This commit is contained in:
Jack Ye 2025-07-23 12:32:37 +01:00 committed by GitHub
commit c604df96e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -501,15 +501,14 @@ namespace Flow.Launcher.ViewModel
// For Dialog Jump and left click mode, we need to navigate to the path // For Dialog Jump and left click mode, we need to navigate to the path
if (_isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick) if (_isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick)
{ {
Hide(); if (result is DialogJumpResult dialogJumpResult)
if (SelectedResults.SelectedItem != null && DialogWindowHandle != nint.Zero)
{ {
if (result is DialogJumpResult dialogJumpResult) Win32Helper.SetForegroundWindow(DialogWindowHandle);
{ _ = Task.Run(() => DialogJump.JumpToPathAsync(DialogWindowHandle, dialogJumpResult.DialogJumpPath));
Win32Helper.SetForegroundWindow(DialogWindowHandle); }
_ = Task.Run(() => DialogJump.JumpToPathAsync(DialogWindowHandle, dialogJumpResult.DialogJumpPath)); else
} {
App.API.LogError(ClassName, "DialogJumpResult expected but got a different result type.");
} }
} }
// For query mode, we execute the result // For query mode, we execute the result