mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-27 11:56:05 +02:00
fix(window-state): window size jump on multi monitor setup (#2583)
* fix: window size jump on multi monitor setup * Add change file
This commit is contained in:
@@ -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()?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user