Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows): get correct monitor in WM_NCCALCSIZE, closes #471 #472

Merged
merged 2 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/correct-monitor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

On Windows, fix assigning the wrong mintor rect to undecorated maximized window. This caused a blank window downstream in wry and tauri.
7 changes: 4 additions & 3 deletions src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,9 +1982,10 @@ unsafe fn public_window_callback_inner<T: 'static>(
if !win_flags.contains(WindowFlags::DECORATIONS) {
// adjust the maximized borderless window so it doesn't cover the taskbar
if util::is_maximized(window) {
let monitor = monitor::current_monitor(window);
if let Ok(monitor_info) = monitor::get_monitor_info(monitor.hmonitor()) {
let params = &mut *(lparam.0 as *mut NCCALCSIZE_PARAMS);
let params = &mut *(lparam.0 as *mut NCCALCSIZE_PARAMS);
if let Ok(monitor_info) =
monitor::get_monitor_info(MonitorFromRect(&params.rgrc[0], MONITOR_DEFAULTTONULL))
{
params.rgrc[0] = monitor_info.monitorInfo.rcWork;
}
}
Expand Down