From 6483e7f4082f268b0e665f6e6cf58e06ffe385b2 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Sun, 9 Oct 2016 16:19:06 +0200 Subject: [PATCH] wayland: Some Window methods --- src/api/wayland/window.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/api/wayland/window.rs b/src/api/wayland/window.rs index bdb063c9..70b0d566 100644 --- a/src/api/wayland/window.rs +++ b/src/api/wayland/window.rs @@ -160,7 +160,10 @@ impl Window { } pub fn set_title(&self, title: &str) { - // TODO + let mut guard = self.evq.lock().unwrap(); + let mut state = guard.state(); + let mut decorated = state.get_mut_handler::>(self.decorated_id); + decorated.set_title(title.into()) } #[inline] @@ -185,19 +188,23 @@ impl Window { } pub fn get_inner_size(&self) -> Option<(u32, u32)> { - // TODO - None + Some(self.size.lock().unwrap().clone()) } #[inline] pub fn get_outer_size(&self) -> Option<(u32, u32)> { - // TODO - None + let (w, h) = self.size.lock().unwrap().clone(); + let (w, h) = super::wayland_window::add_borders(w as i32, h as i32); + Some((w as u32, h as u32)) } #[inline] + // NOTE: This will only resize the borders, the contents must be updated by the user pub fn set_inner_size(&self, x: u32, y: u32) { - // TODO + let mut guard = self.evq.lock().unwrap(); + let mut state = guard.state(); + let mut decorated = state.get_mut_handler::>(self.decorated_id); + decorated.resize(x as i32, y as i32); } #[inline]