diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bar.rs | 21 | ||||
| -rw-r--r-- | src/main.rs | 4 |
2 files changed, 14 insertions, 11 deletions
@@ -164,15 +164,18 @@ impl Bar { let width_f = self.width as f64; let height_f = self.height as f64; - let (buffer, canvas) = ss.shm.alloc_buffer( - conn, - BufferSpec { - width: pix_width, - height: pix_height, - stride: pix_width * 4, - format: wl_shm::Format::Argb8888, - }, - ); + let (buffer, canvas) = ss + .shm + .alloc_buffer( + conn, + BufferSpec { + width: pix_width, + height: pix_height, + stride: pix_width * 4, + format: wl_shm::Format::Argb8888, + }, + ) + .unwrap(); let cairo_surf = unsafe { cairo::ImageSurface::create_for_data_unsafe( diff --git a/src/main.rs b/src/main.rs index e2395d7..1befd65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,8 +49,8 @@ fn main() -> anyhow::Result<()> { let mut state = State::new(&mut conn, &globals, &mut el, args.config.as_deref()); conn.flush(IoMode::Blocking)?; - el.register_with_fd(sig_read, move |ctx| { - nix::unistd::read(sig_read, &mut [0; 1])?; + el.register_with_fd(sig_read.as_raw_fd(), move |ctx| { + nix::unistd::read(sig_read.as_raw_fd(), &mut [0; 1])?; ctx.state.toggle_visibility(ctx.conn); Ok(event_loop::Action::Keep) }); |
