File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 2424using Flow . Launcher . Plugin . SharedCommands ;
2525using Flow . Launcher . Storage ;
2626using Microsoft . VisualStudio . Threading ;
27+ using static System . Windows . Forms . VisualStyles . VisualStyleElement . Window ;
2728
2829namespace Flow . Launcher . ViewModel
2930{
@@ -1627,7 +1628,6 @@ public async void SetupQuickSwitch(nint handle)
16271628
16281629 dialogWindowHandleChanged = true ;
16291630
1630- // Wait for a while to make sure the dialog is shown
16311631 // If don't give a time, Positioning will be weird
16321632 await Task . Delay ( 300 ) ;
16331633 }
@@ -1667,6 +1667,22 @@ public async void SetupQuickSwitch(nint handle)
16671667 }
16681668 }
16691669 }
1670+
1671+ if ( QuickSwitchWindowPosition == QuickSwitchWindowPositions . UnderDialog )
1672+ {
1673+ _ = Task . Run ( ( ) =>
1674+ {
1675+ // Wait for a while to make sure the dialog is shown and quick switch window has gotten the focus
1676+ var timeOut = ! SpinWait . SpinUntil ( ( ) => Win32Helper . GetForegroundWindowHWND ( ) != DialogWindowHandle , 1000 ) ;
1677+ if ( timeOut )
1678+ {
1679+ return ;
1680+ }
1681+
1682+ // Bring focus back to the the dialog
1683+ Win32Helper . SetForegroundWindow ( DialogWindowHandle ) ;
1684+ } ) ;
1685+ }
16701686 }
16711687
16721688 public async void ResetQuickSwitch ( )
You can’t perform that action at this time.
0 commit comments