mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 05:21:31 +11:00
On X11, fix window hints not persisting
This commit fixes the issue with min, max, and resize increments not persisting across the dpi changes.
This commit is contained in:
parent
6b7ceedc91
commit
cdbaf4816a
|
@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
|||
|
||||
# Unreleased
|
||||
|
||||
- On X11, fix min, max and resize increment hints not persisting for resizable windows (e.g. on DPI change).
|
||||
- On Windows, respect min/max inner sizes when creating the window.
|
||||
|
||||
# 0.27.1 (2022-07-30)
|
||||
|
|
|
@ -371,15 +371,15 @@ impl UnownedWindow {
|
|||
} else {
|
||||
max_inner_size = Some(dimensions.into());
|
||||
min_inner_size = Some(dimensions.into());
|
||||
|
||||
let mut shared_state = window.shared_state.get_mut();
|
||||
shared_state.min_inner_size = window_attrs.min_inner_size;
|
||||
shared_state.max_inner_size = window_attrs.max_inner_size;
|
||||
shared_state.resize_increments = pl_attribs.resize_increments;
|
||||
shared_state.base_size = pl_attribs.base_size;
|
||||
}
|
||||
}
|
||||
|
||||
let mut shared_state = window.shared_state.get_mut();
|
||||
shared_state.min_inner_size = min_inner_size.map(Into::into);
|
||||
shared_state.max_inner_size = max_inner_size.map(Into::into);
|
||||
shared_state.resize_increments = pl_attribs.resize_increments;
|
||||
shared_state.base_size = pl_attribs.base_size;
|
||||
|
||||
let mut normal_hints = util::NormalHints::new(xconn);
|
||||
normal_hints.set_position(position.map(|PhysicalPosition { x, y }| (x, y)));
|
||||
normal_hints.set_size(Some(dimensions));
|
||||
|
|
Loading…
Reference in a new issue