Showing
1 changed file
with
5 additions
and
3 deletions
@@ -36,7 +36,7 @@ pub struct XcbCanvas<'a> { conn :Arc<xcb::Connection> | @@ -36,7 +36,7 @@ pub struct XcbCanvas<'a> { conn :Arc<xcb::Connection> | ||
36 | , window :u32 | 36 | , window :u32 |
37 | , pixmap :u32 | 37 | , pixmap :u32 |
38 | , gc :u32 | 38 | , gc :u32 |
39 | - , shm :&'a mut [u32] } | 39 | + , shm :Box<&'a mut [u32]> } |
40 | 40 | ||
41 | impl XcbEasel { | 41 | impl XcbEasel { |
42 | pub fn new() -> Result<XcbEasel, xcb::ConnError> { | 42 | pub fn new() -> Result<XcbEasel, xcb::ConnError> { |
@@ -55,7 +55,7 @@ impl XcbEasel { | @@ -55,7 +55,7 @@ impl XcbEasel { | ||
55 | self.setup().roots().nth(*num as usize) | 55 | self.setup().roots().nth(*num as usize) |
56 | } | 56 | } |
57 | 57 | ||
58 | - pub fn canvas(&self, width :u16, height :u16) -> Option<XcbCanvas> { | 58 | + pub fn canvas<'a>(&self, width :u16, height :u16) -> Option<XcbCanvas<'a>> { |
59 | let Self(conn, _) = self; | 59 | let Self(conn, _) = self; |
60 | let conn = conn.clone(); | 60 | let conn = conn.clone(); |
61 | let screen = match self.screen() { | 61 | let screen = match self.screen() { |
@@ -63,6 +63,8 @@ impl XcbEasel { | @@ -63,6 +63,8 @@ impl XcbEasel { | ||
63 | Some(screen) => screen, | 63 | Some(screen) => screen, |
64 | }; | 64 | }; |
65 | 65 | ||
66 | + println!("root depth: {}", screen.root_depth()); | ||
67 | + | ||
66 | let shmseg = conn.generate_id(); | 68 | let shmseg = conn.generate_id(); |
67 | let gc = conn.generate_id(); | 69 | let gc = conn.generate_id(); |
68 | let pixmap = conn.generate_id(); | 70 | let pixmap = conn.generate_id(); |
@@ -94,7 +96,7 @@ impl XcbEasel { | @@ -94,7 +96,7 @@ impl XcbEasel { | ||
94 | , window: window | 96 | , window: window |
95 | , pixmap: pixmap | 97 | , pixmap: pixmap |
96 | , gc: gc | 98 | , gc: gc |
97 | - , shm: shm } ) | 99 | + , shm: Box::new(shm) } ) |
98 | } | 100 | } |
99 | } | 101 | } |
100 | 102 |
Please
register
or
login
to post a comment