mirror of
https://github.com/reactos/reactos.git
synced 2024-07-03 03:04:22 +00:00
[USER32] Switch to only one window (Alt+Tab) (#1718)
Fix app switcher (Alt+Tab)'s behavior when there is only one app window. CORE-16176
This commit is contained in:
parent
28a0aa9ae8
commit
c17a8770a3
|
@ -481,11 +481,13 @@ BOOL ProcessHotKey(VOID)
|
||||||
|
|
||||||
if (windowCount == 1)
|
if (windowCount == 1)
|
||||||
{
|
{
|
||||||
selectedWindow = 0;
|
MakeWindowActive(windowList[0]);
|
||||||
CompleteSwitch(TRUE);
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!CreateSwitcherWindow(User32Instance))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
selectedWindow = 1;
|
selectedWindow = 1;
|
||||||
|
|
||||||
TRACE("[ATbot] HotKey Received. Opening window.\n");
|
TRACE("[ATbot] HotKey Received. Opening window.\n");
|
||||||
|
@ -610,10 +612,6 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
// Already in the loop.
|
// Already in the loop.
|
||||||
if (switchdialog || Esc) return 0;
|
if (switchdialog || Esc) return 0;
|
||||||
|
|
||||||
hwndActive = GetActiveWindow();
|
|
||||||
// Nothing is active so exit.
|
|
||||||
if (!hwndActive) return 0;
|
|
||||||
|
|
||||||
if (lParam == VK_ESCAPE)
|
if (lParam == VK_ESCAPE)
|
||||||
{
|
{
|
||||||
Esc = TRUE;
|
Esc = TRUE;
|
||||||
|
@ -636,14 +634,15 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capture current active window.
|
// Capture current active window.
|
||||||
SetCapture( hwndActive );
|
hwndActive = GetActiveWindow();
|
||||||
|
if (hwndActive)
|
||||||
|
SetCapture(hwndActive);
|
||||||
|
|
||||||
switch (lParam)
|
switch (lParam)
|
||||||
{
|
{
|
||||||
case VK_TAB:
|
case VK_TAB:
|
||||||
if( !CreateSwitcherWindow(User32Instance) ) goto Exit;
|
if (!GetDialogFont() || !ProcessHotKey())
|
||||||
if( !GetDialogFont() ) goto Exit;
|
goto Exit;
|
||||||
if( !ProcessHotKey() ) goto Exit;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VK_ESCAPE:
|
case VK_ESCAPE:
|
||||||
|
@ -652,6 +651,10 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
default:
|
default:
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hwndActive)
|
||||||
|
goto Exit;
|
||||||
|
|
||||||
// Main message loop:
|
// Main message loop:
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue