Skip to content

Commit a35fea5

Browse files
fix(window-state): window size jump on multi monitor setup (#2583)
* fix: window size jump on multi monitor setup * Add change file
1 parent a77b135 commit a35fea5

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
window-state: patch
3+
window-state-js: patch
4+
---
5+
6+
Fix window size gets bigger/smaller on secondary monitor with a different scaling than the primary one

plugins/window-state/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,6 @@ impl<R: Runtime> WindowExt for Window<R> {
184184
self.set_decorations(state.decorated)?;
185185
}
186186

187-
if flags.contains(StateFlags::SIZE) {
188-
self.set_size(PhysicalSize {
189-
width: state.width,
190-
height: state.height,
191-
})?;
192-
}
193-
194187
if flags.contains(StateFlags::POSITION) {
195188
let position = (state.x, state.y).into();
196189
let size = (state.width, state.height).into();
@@ -214,6 +207,13 @@ impl<R: Runtime> WindowExt for Window<R> {
214207
}
215208
}
216209

210+
if flags.contains(StateFlags::SIZE) {
211+
self.set_size(PhysicalSize {
212+
width: state.width,
213+
height: state.height,
214+
})?;
215+
}
216+
217217
if flags.contains(StateFlags::MAXIMIZED) && state.maximized {
218218
self.maximize()?;
219219
}

0 commit comments

Comments
 (0)