wayland: implement set_resizable (#565)

This commit is contained in:
Victor Berger 2018-06-13 17:18:44 +02:00 committed by Francesca Frangipane
parent 233ac4aed2
commit ced1616e51
4 changed files with 11 additions and 4 deletions

View file

@ -2,8 +2,8 @@
- On X11, the `Moved` event is no longer sent when the window is resized without changing position. - On X11, the `Moved` event is no longer sent when the window is resized without changing position.
- `MouseCursor` and `CursorState` now implement `Default`. - `MouseCursor` and `CursorState` now implement `Default`.
- `WindowBuilder::with_resizable` implemented for Windows, X11, and macOS. - `WindowBuilder::with_resizable` implemented for Windows, X11, Wayland, and macOS.
- `Window::set_resizable` implemented for Windows, X11, and macOS. - `Window::set_resizable` implemented for Windows, X11, Wayland, and macOS.
- On X11, if the monitor's width or height in millimeters is reported as 0, the DPI is now 1.0 instead of +inf. - On X11, if the monitor's width or height in millimeters is reported as 0, the DPI is now 1.0 instead of +inf.
- On X11, the environment variable `WINIT_HIDPI_FACTOR` has been added for overriding DPI factor. - On X11, the environment variable `WINIT_HIDPI_FACTOR` has been added for overriding DPI factor.
- On X11, enabling transparency no longer causes the window contents to flicker when resizing. - On X11, enabling transparency no longer causes the window contents to flicker when resizing.

View file

@ -53,7 +53,7 @@ features = [
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies] [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies]
wayland-client = { version = "0.20.6", features = [ "dlopen", "egl", "cursor"] } wayland-client = { version = "0.20.6", features = [ "dlopen", "egl", "cursor"] }
smithay-client-toolkit = "0.2.1" smithay-client-toolkit = "0.2.2"
x11-dl = "2.17.5" x11-dl = "2.17.5"
parking_lot = "0.5" parking_lot = "0.5"
percent-encoding = "1.0" percent-encoding = "1.0"

View file

@ -237,7 +237,7 @@ impl Window {
pub fn set_resizable(&self, resizable: bool) { pub fn set_resizable(&self, resizable: bool) {
match self { match self {
&Window::X(ref w) => w.set_resizable(resizable), &Window::X(ref w) => w.set_resizable(resizable),
&Window::Wayland(ref _w) => unimplemented!(), &Window::Wayland(ref w) => w.set_resizable(resizable),
} }
} }

View file

@ -101,6 +101,8 @@ impl Window {
frame.set_maximized(); frame.set_maximized();
} }
frame.set_resizable(attributes.resizable);
// set decorations // set decorations
frame.set_decorate(attributes.decorations); frame.set_decorate(attributes.decorations);
@ -198,6 +200,11 @@ impl Window {
self.frame.lock().unwrap().set_max_size(dimensions); self.frame.lock().unwrap().set_max_size(dimensions);
} }
#[inline]
pub fn set_resizable(&self, resizable: bool) {
self.frame.lock().unwrap().set_resizable(resizable);
}
#[inline] #[inline]
pub fn set_cursor(&self, _cursor: MouseCursor) { pub fn set_cursor(&self, _cursor: MouseCursor) {
// TODO // TODO