Skip to content

Commit

Permalink
fix(windows): remove borders if fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 20, 2024
1 parent 720bd93 commit 7d5cec1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/windows-fullscreen-undecorated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": "patch"
---

On Windows, fix fullscreen for undecorated window have white borders.
3 changes: 2 additions & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,7 @@ unsafe fn public_window_callback_inner<T: 'static>(

win32wm::WM_NCCALCSIZE => {
let window_flags = subclass_input.window_state.lock().window_flags();
let is_fullscreen = subclass_input.window_state.lock().fullscreen.is_some();

if wparam == WPARAM(0) || window_flags.contains(WindowFlags::MARKER_DECORATIONS) {
result = ProcResult::DefSubclassProc;
Expand Down Expand Up @@ -2141,7 +2142,7 @@ unsafe fn public_window_callback_inner<T: 'static>(

params.rgrc[0] = rect;
}
} else if window_flags.contains(WindowFlags::MARKER_UNDECORATED_SHADOW) {
} else if window_flags.contains(WindowFlags::MARKER_UNDECORATED_SHADOW) && !is_fullscreen {
let params = &mut *(lparam.0 as *mut NCCALCSIZE_PARAMS);
params.rgrc[0].top += 1;
params.rgrc[0].bottom += 1;
Expand Down

0 comments on commit 7d5cec1

Please sign in to comment.