diff options
Diffstat (limited to 'src/x/window.rs')
| -rw-r--r-- | src/x/window.rs | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/x/window.rs b/src/x/window.rs index d264eb9..a1a4a19 100644 --- a/src/x/window.rs +++ b/src/x/window.rs @@ -18,6 +18,13 @@ pub struct Window { window_id: x::Window, } +impl HasConnection for Window { + fn connection(&self) -> &Connection { self.display.connection() } +} + +impl HasDisplay for Window { + fn display(&self) -> &Arc<Display> { &self.display } +} impl Window { @@ -39,8 +46,6 @@ impl Window { pub trait HasWindow { fn window(&self) -> &Window; - - fn window_id(&self) -> x::Window { self.window().window_id } } impl HasWindow for Window { @@ -52,19 +57,11 @@ impl<T: Deref<Target=Window>> HasWindow for T { } -impl HasConnection for Window { - fn connection(&self) -> &Connection { self.display.connection() } -} - - -impl HasDisplay for Window { - fn display(&self) -> &Arc<Display> { &self.display } -} - - - - pub trait WindowExt: HasWindow + HasDisplay + HasConnection { + fn window_id(&self) -> x::Window { + self.window().window_id + } + fn map_window(&self) -> xcb::Result<()> { let connection = self.connection(); @@ -111,7 +108,6 @@ pub trait WindowExt: HasWindow + HasDisplay + HasConnection { Ok(()) } - fn set_cardinal_property(&self, property: &Atom, values: &[u32]) -> xcb::Result<()> { |