diff --git a/.changes/windows-fullscreen-undecorated.md b/.changes/windows-fullscreen-undecorated.md new file mode 100644 index 000000000..2420f5858 --- /dev/null +++ b/.changes/windows-fullscreen-undecorated.md @@ -0,0 +1,5 @@ +--- +"tao": "patch" +--- + +On Windows, fix fullscreen for undecorated window have white borders. \ No newline at end of file diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index caf53928c..cc8d22384 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -2101,6 +2101,7 @@ unsafe fn public_window_callback_inner( 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; @@ -2141,7 +2142,7 @@ unsafe fn public_window_callback_inner( 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;