Bring the window above the others when an Arena champ select starts (#118)
Out of the foreground, SetWindowPos(HWND_TOP) left the restored window where it was: under a maximized Chrome on its screen. A topmost round trip puts it above every normal window, League included, still without activation. A window hidden in the notification area is now shown by ShowWindow (SW_SHOWNA): SWP_SHOWWINDOW sent GPUI no WM_SHOWWINDOW, so it never saw the window as visible and the entry animation could not play. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #121.
This commit is contained in:
1 parent
986c090d78
commit
1cb7b2b11d
2 files changed
+13
-13
No files matched your search
+12
-12
@@ -330,20 +330,20 @@ pub fn reveal(hwnd: HWND) {
|
||||
if let Some(tray) = installed_tray(hwnd) {
|
||||
tray.remove_icon();
|
||||
}
|
||||
if iconic {
|
||||
let command = if iconic {
|
||||
// shortcut: a window minimized from maximized may come back at its normal size, as no
|
||||
// show command maximizes without activating; revisit if the Windows check shows it.
|
||||
let _ = ShowWindow(hwnd, SW_SHOWNOACTIVATE);
|
||||
}
|
||||
let _ = SetWindowPos(
|
||||
hwnd,
|
||||
Some(HWND_TOP),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW,
|
||||
);
|
||||
SW_SHOWNOACTIVATE
|
||||
} else {
|
||||
SW_SHOWNA
|
||||
};
|
||||
// ShowWindow sends the WM_SHOWWINDOW or WM_SIZE that tells GPUI the window is visible.
|
||||
let _ = ShowWindow(hwnd, command);
|
||||
// While another app has the foreground, HWND_TOP leaves the window where it is: a topmost
|
||||
// round trip puts it above every non-topmost window, still without activating it.
|
||||
let flags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE;
|
||||
let _ = SetWindowPos(hwnd, Some(HWND_TOPMOST), 0, 0, 0, 0, flags);
|
||||
let _ = SetWindowPos(hwnd, Some(HWND_NOTOPMOST), 0, 0, 0, 0, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user