mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
committed by
Francesca Frangipane
parent
79aebf06dc
commit
2cc8fa1eac
@@ -216,16 +216,23 @@ impl UnownedWindow {
|
||||
|
||||
// set size hints
|
||||
{
|
||||
let mut min_dimensions = window_attrs.min_dimensions;
|
||||
let mut max_dimensions = window_attrs.max_dimensions;
|
||||
if !window_attrs.resizable {
|
||||
max_dimensions = Some(dimensions);
|
||||
min_dimensions = Some(dimensions);
|
||||
}
|
||||
|
||||
let mut size_hints = xconn.alloc_size_hints();
|
||||
(*size_hints).flags = ffi::PSize;
|
||||
(*size_hints).width = dimensions.0 as c_int;
|
||||
(*size_hints).height = dimensions.1 as c_int;
|
||||
if let Some((min_width, min_height)) = window_attrs.min_dimensions {
|
||||
if let Some((min_width, min_height)) = min_dimensions {
|
||||
(*size_hints).flags |= ffi::PMinSize;
|
||||
(*size_hints).min_width = min_width as c_int;
|
||||
(*size_hints).min_height = min_height as c_int;
|
||||
}
|
||||
if let Some((max_width, max_height)) = window_attrs.max_dimensions {
|
||||
if let Some((max_width, max_height)) = max_dimensions {
|
||||
(*size_hints).flags |= ffi::PMaxSize;
|
||||
(*size_hints).max_width = max_width as c_int;
|
||||
(*size_hints).max_height = max_height as c_int;
|
||||
|
||||
Reference in New Issue
Block a user