summary refs log tree commit diff
path: root/src/x/window.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-11-11 22:15:21 -0700
committerIrene Knapp <ireneista@irenes.space>2026-11-11 22:15:21 -0700
commitcea4c230b40d5ea2851ed3f97f73b2554849dc34 (patch)
treeb4050e1f499c81df4d9a2fe368c2ebcc7d9e982b /src/x/window.rs
parent960663d476d8a1391b8bcc4424f3f716147068ab (diff)
moves towards nontrivial drawing
also, a little cleanup of trait consistency

Force-Push: yes
Change-Id: I71e07685d605ec93d98982b3660dcd8d154f8d9d
Diffstat (limited to 'src/x/window.rs')
-rw-r--r--src/x/window.rs26
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<()>
   {