Wayland: Fix window creation dimensions (#577)

* Wayland: Fix window creation dimensions

* Wayland: Fix window creation min/max
This commit is contained in:
Francesca Frangipane 2018-06-24 08:28:57 -04:00 committed by GitHub
parent 047c67baf3
commit c873c2db15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));