fix(window-state): window size jump on multi monitor setup (#2583)

* fix: window size jump on multi monitor setup

* Add change file
pull/2585/head
Tony 2 months ago committed by GitHub
parent a77b1353e9
commit a35fea5015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,6 @@
---
window-state: patch
window-state-js: patch
---
Fix window size gets bigger/smaller on secondary monitor with a different scaling than the primary one

@ -184,13 +184,6 @@ impl<R: Runtime> WindowExt for Window<R> {
self.set_decorations(state.decorated)?;
}
if flags.contains(StateFlags::SIZE) {
self.set_size(PhysicalSize {
width: state.width,
height: state.height,
})?;
}
if flags.contains(StateFlags::POSITION) {
let position = (state.x, state.y).into();
let size = (state.width, state.height).into();
@ -214,6 +207,13 @@ impl<R: Runtime> WindowExt for Window<R> {
}
}
if flags.contains(StateFlags::SIZE) {
self.set_size(PhysicalSize {
width: state.width,
height: state.height,
})?;
}
if flags.contains(StateFlags::MAXIMIZED) && state.maximized {
self.maximize()?;
}

Loading…
Cancel
Save