Repository navigation
topbar: fix switching back to exclusive-fullscreen games - #165
Open
enthonyaraujo wants to merge 5 commits into
Open
enthonyaraujo wants to merge 5 commits into
enthonyaraujo wants to merge 5 commits into
Conversation
Switching to an exclusive-fullscreen game (such as PUBG) via the bar or Alt+Tab could bounce right back to the desktop or previous window: - Hide the bar immediately when entering fullscreen (and before activating a fullscreen target window) instead of running a 240 ms slide-out loop that repeatedly called SetWindowPos(HWND_TOPMOST) over the display. - Defer place() (SHAppBarMessage / SPI_SETWORKAREA / HWND_TOPMOST) when WM_DISPLAYCHANGE or ABN_POSCHANGED arrives during a fullscreen mode switch, applying it once fullscreen ends; also skip raising HOST to HWND_TOPMOST while fullscreen. - Add winrust_common::fg::activate() for external windows (used by bar clicks, Alt+Tab, hover previews, app menu and Win+1..9): acquires foreground rights before ShowWindow(SW_RESTORE), calls AllowSetForegroundWindow, resolves GetLastActivePopup, and avoids injecting synthetic Alt keys once SetForegroundWindow succeeds. - Trigger app-button left clicks on WM_LBUTTONUP (matching preview / Alt+Tab cards) so the mouse button is not held during activation. - In Alt+Tab, start at index 0 when the desktop is currently focused instead of skipping the most recent window.
A game switching into exclusive fullscreen (Elden Ring) dropped out of it again, in a loop, or stayed black after Alt+Tab: - while the game switches the display mode there is no foreground window for a moment; the bar took that as "fullscreen is over", came back on top and knocked the game out. The bar now returns only after 1.5 s without fullscreen. - place() and the slide animation re-inserted the bar at HWND_TOPMOST on every display change, i.e. above the game that had just become topmost. They keep the bar's z-order now (it is topmost from its creation); only a bar that comes back from hidden is raised. - a fullscreen game brought back with Alt+Tab has the foreground while still minimized: the window that was last seen fullscreen (and any D3D app Windows reports as fullscreen, SHQueryUserNotificationState) counts as fullscreen then. - switching to a minimized window (Alt+Tab, its button, a preview, the menu) restored it first and activated it after; the game got the foreground, lost it to the previous window and got it again, and gave up on fullscreen. Minimized windows now go through SwitchToThisWindow like Windows' own Alt+Tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks for this! #197 (just merged into |
Rebased on Lemxy#197, keeping only the cases still broken on top of it: - Defer place() while FULLSCREEN is active (on WM_DISPLAYCHANGE / ABN_POSCHANGED) and run it once fullscreen ends: a game running at a lower resolution than the desktop (e.g. stretched 1280x960 on 1920x1080) otherwise shrinks SPI_SETWORKAREA and trims maximized desktop windows via fit_maximized(), leaving them permanently shrunk after exiting the game. - Recognize any minimized fullscreen window on the primary monitor via GetWindowPlacement (in addition to FS_WND), so switching back still counts as fullscreen after another fullscreen window (e.g. F11 browser) overwrote FS_WND or after the bar restarted; also check QUNS_RUNNING_D3D_FULL_SCREEN before returning false on a transiently null foreground window. - Hide the bar immediately when entering fullscreen (and before activating a fullscreen target in bring()) instead of keeping the WS_EX_TOPMOST bar visible during a 240 ms slide-out, and skip raising HOST to HWND_TOPMOST while fullscreen. - In bring(), resolve GetLastActivePopup(w) and avoid injecting synthetic VK_MENU keys when SetForegroundWindow already succeeded; trigger app-button left clicks on WM_LBUTTONUP so the mouse button is not held down during AttachThreadInput / restore. - In Alt+Tab, start at index 0 when the desktop is focused instead of skipping the most recent window.
Author
|
Thanks for the heads-up! I checked |
…uperseded by rebase onto Lemxy#197)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem