mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Unify behavior of resizable across platforms
This makes X11 and Wayland follow Windows and macOS, so the size of the window could be set even though it has resizable attribute set to false. Fixes #2242.
This commit is contained in:
@@ -1115,8 +1115,15 @@ impl UnownedWindow {
|
||||
#[inline]
|
||||
pub fn set_inner_size(&self, size: Size) {
|
||||
let scale_factor = self.scale_factor();
|
||||
let (width, height) = size.to_physical::<u32>(scale_factor).into();
|
||||
self.set_inner_size_physical(width, height);
|
||||
let size = size.to_physical::<u32>(scale_factor).into();
|
||||
if !self.shared_state.lock().is_resizable {
|
||||
self.update_normal_hints(|normal_hints| {
|
||||
normal_hints.set_min_size(Some(size));
|
||||
normal_hints.set_max_size(Some(size));
|
||||
})
|
||||
.expect("Failed to call `XSetWMNormalHints`");
|
||||
}
|
||||
self.set_inner_size_physical(size.0, size.1);
|
||||
}
|
||||
|
||||
fn update_normal_hints<F>(&self, callback: F) -> Result<(), XError>
|
||||
|
||||
Reference in New Issue
Block a user