mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11:00
Wayland: Fix window creation dimensions (#577)
* Wayland: Fix window creation dimensions * Wayland: Fix window creation min/max
This commit is contained in:
parent
047c67baf3
commit
c873c2db15
|
@ -29,9 +29,7 @@ pub struct Window {
|
|||
|
||||
impl Window {
|
||||
pub fn new(evlp: &EventsLoop, attributes: WindowAttributes) -> Result<Window, CreationError> {
|
||||
// TODO: Update for new DPI API
|
||||
//let (width, height) = attributes.dimensions.unwrap_or((800, 600));
|
||||
let (width, height) = (64, 64);
|
||||
let (width, height) = attributes.dimensions.map(Into::into).unwrap_or((800, 600));
|
||||
// Create the window
|
||||
let size = Arc::new(Mutex::new((width, height)));
|
||||
|
||||
|
@ -131,9 +129,8 @@ impl Window {
|
|||
frame.set_decorate(attributes.decorations);
|
||||
|
||||
// min-max dimensions
|
||||
// TODO: Update for new DPI API
|
||||
//frame.set_min_size(attributes.min_dimensions);
|
||||
//frame.set_max_size(attributes.max_dimensions);
|
||||
frame.set_min_size(attributes.min_dimensions.map(Into::into));
|
||||
frame.set_max_size(attributes.max_dimensions.map(Into::into));
|
||||
|
||||
let kill_switch = Arc::new(Mutex::new(false));
|
||||
let need_frame_refresh = Arc::new(Mutex::new(true));
|
||||
|
|
Loading…
Reference in a new issue