From cea4c230b40d5ea2851ed3f97f73b2554849dc34 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Wed, 11 Nov 2026 22:15:21 -0700 Subject: moves towards nontrivial drawing also, a little cleanup of trait consistency Force-Push: yes Change-Id: I71e07685d605ec93d98982b3660dcd8d154f8d9d --- src/x/window.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/x/window.rs') 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 { &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> HasWindow for T { } -impl HasConnection for Window { - fn connection(&self) -> &Connection { self.display.connection() } -} - - -impl HasDisplay for Window { - fn display(&self) -> &Arc { &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<()> { -- cgit 1.4.1