Fix Windows fullscreen gap when toggling from maximized #80

Merged
Ghost merged 2 commits from Babib3l/Ryubing:fix-windows-fullscreen-f11 into master 2026-05-10 23:47:40 +00:00
Contributor

This PR aims to Fix the Windows fullscreen gap when toggling from maximized state by using canonical Win32 fullscreen approach. When entering fullscreen, the window style is saved and replaced with WS_POPUP | WS_VISIBLE to remove all window chrome (title bar, borders), then SetWindowPos sizes the window to cover the full screen with SWP_FRAMECHANGED to force Win32 to recalculate the frame. On exit, the original window style is restored. This eliminates the few-pixel gap at the top that occurred because Avalonia's WindowState = FullScreen transition from a maximized state retained the title bar non-client area, leaving visible space at the top of the screen (Fullscreen resolution would be 1920 x 1072p on a 1080p monitor, it now correctly renders at 1920 x 1080p)

This PR aims to Fix the Windows fullscreen gap when toggling from maximized state by using canonical Win32 fullscreen approach. When entering fullscreen, the window style is saved and replaced with WS_POPUP | WS_VISIBLE to remove all window chrome (title bar, borders), then SetWindowPos sizes the window to cover the full screen with SWP_FRAMECHANGED to force Win32 to recalculate the frame. On exit, the original window style is restored. This eliminates the few-pixel gap at the top that occurred because Avalonia's WindowState = FullScreen transition from a maximized state retained the title bar non-client area, leaving visible space at the top of the screen (Fullscreen resolution would be 1920 x 1072p on a 1080p monitor, it now correctly renders at 1920 x 1080p)
@ -2041,0 +2067,4 @@
Win32NativeInterop.SetWindowLongPtrW(hwnd, Win32NativeInterop.GWL_STYLE,
unchecked((nint)(Win32NativeInterop.WS_POPUP | Win32NativeInterop.WS_VISIBLE)));
var screen = Window.Screens.ScreenFromVisual(Window);

Can we specify the type here instead of using var?

Can we specify the type here instead of using ``var``?
Babib3l marked this conversation as resolved
Ghost force-pushed fix-windows-fullscreen-f11 from 25831e6e98
All checks were successful
Build PR / linux-arm64 (Release) (pull_request_target) Successful in 5m13s
Build PR / macOS Universal (Release) (pull_request_target) Successful in 8m37s
Build PR / linux-x64 (Release) (pull_request_target) Successful in 8m42s
Build PR / win-x64 (Release) (pull_request_target) Successful in 8m58s
Build PR / Post comment linking uploaded artifacts (pull_request_target) Successful in 4s
to 811add944a
All checks were successful
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m28s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m47s
Build PR / win-x64 (Release) (pull_request) Successful in 8m49s
Build PR / macOS Universal (Release) (pull_request) Successful in 9m1s
2026-05-10 23:47:28 +00:00
Compare
Ghost merged commit bab160d650 into master 2026-05-10 23:47:40 +00:00
Ghost deleted branch fix-windows-fullscreen-f11 2026-05-10 23:47:40 +00:00
Ghost referenced this pull request from a commit 2026-05-25 12:09:01 +00:00
Ghost added this to the 1.4.0 milestone 2026-06-27 17:12:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
projects/Ryubing!80
No description provided.