Showing
1 changed file
with
5 additions
and
3 deletions
... | ... | @@ -36,7 +36,7 @@ pub struct XcbCanvas<'a> { conn :Arc<xcb::Connection> |
36 | 36 | , window :u32 |
37 | 37 | , pixmap :u32 |
38 | 38 | , gc :u32 |
39 | - , shm :&'a mut [u32] } | |
39 | + , shm :Box<&'a mut [u32]> } | |
40 | 40 | |
41 | 41 | impl XcbEasel { |
42 | 42 | pub fn new() -> Result<XcbEasel, xcb::ConnError> { |
... | ... | @@ -55,7 +55,7 @@ impl XcbEasel { |
55 | 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 | 59 | let Self(conn, _) = self; |
60 | 60 | let conn = conn.clone(); |
61 | 61 | let screen = match self.screen() { |
... | ... | @@ -63,6 +63,8 @@ impl XcbEasel { |
63 | 63 | Some(screen) => screen, |
64 | 64 | }; |
65 | 65 | |
66 | + println!("root depth: {}", screen.root_depth()); | |
67 | + | |
66 | 68 | let shmseg = conn.generate_id(); |
67 | 69 | let gc = conn.generate_id(); |
68 | 70 | let pixmap = conn.generate_id(); |
... | ... | @@ -94,7 +96,7 @@ impl XcbEasel { |
94 | 96 | , window: window |
95 | 97 | , pixmap: pixmap |
96 | 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