diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-03-23 18:49:47 +0200 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-03-23 19:01:49 +0200 |
| commit | 210991f37fca6c4ae94979356ae8e55e048c232e (patch) | |
| tree | 4e1fef8b8e6515ef8a775a0111fbf6e26c32e3cf /src | |
| parent | e195a50d75c394a69a7228f8c1e5ad320c3ad06d (diff) | |
| download | i3bar-mango-210991f37fca6c4ae94979356ae8e55e048c232e.tar.gz | |
update dependencies
Diffstat (limited to 'src')
| -rw-r--r-- | src/bar.rs | 2 | ||||
| -rw-r--r-- | src/shared_state.rs | 2 | ||||
| -rw-r--r-- | src/state.rs | 17 |
3 files changed, 8 insertions, 13 deletions
@@ -3,7 +3,7 @@ use std::collections::BinaryHeap; use pangocairo::cairo; use wayrs_client::connection::Connection; -use wayrs_shm_alloc::BufferSpec; +use wayrs_utils::shm_alloc::BufferSpec; use crate::button_manager::ButtonManager; use crate::color::Color; diff --git a/src/shared_state.rs b/src/shared_state.rs index fd4084e..7f88afa 100644 --- a/src/shared_state.rs +++ b/src/shared_state.rs @@ -2,7 +2,7 @@ use crate::{ config::Config, i3bar_protocol::Block, state::ComputedBlock, status_cmd::StatusCmd, wm_info_provider::WmInfoProvider, }; -use wayrs_shm_alloc::ShmAlloc; +use wayrs_utils::shm_alloc::ShmAlloc; pub struct SharedState { pub shm: ShmAlloc, diff --git a/src/state.rs b/src/state.rs index b9f11df..fa8d7c9 100644 --- a/src/state.rs +++ b/src/state.rs @@ -7,8 +7,8 @@ use std::future::pending; use wayrs_client::connection::Connection; use wayrs_client::global::{Global, GlobalExt, Globals, GlobalsExt}; use wayrs_client::proxy::Proxy; -use wayrs_cursor::CursorTheme; -use wayrs_shm_alloc::ShmAlloc; +use wayrs_utils::cursor::CursorTheme; +use wayrs_utils::shm_alloc::ShmAlloc; use crate::{ bar::Bar, config::Config, i3bar_protocol::Block, pointer_btn::PointerBtn, @@ -55,7 +55,7 @@ impl State { .as_ref() .and_then(|cmd| StatusCmd::new(cmd).map_err(|e| error = Err(e)).ok()); - conn.set_callback_for(conn.registry(), wl_registry_cb); + conn.add_registry_cb(wl_registry_cb); let wl_shm = globals.bind(conn, 1..=1).expect("could not bind wl_shm"); @@ -258,12 +258,7 @@ impl State { } } -fn wl_registry_cb( - conn: &mut Connection<State>, - state: &mut State, - _: WlRegistry, - event: wl_registry::Event, -) { +fn wl_registry_cb(conn: &mut Connection<State>, state: &mut State, event: &wl_registry::Event) { match event { wl_registry::Event::Global(global) if global.is::<WlOutput>() => { state.bind_output(conn, &global); @@ -275,11 +270,11 @@ fn wl_registry_cb( if let Some(bar_index) = state .bars .iter() - .position(|bar| bar.output_reg_name == name) + .position(|bar| bar.output_reg_name == *name) { state.drop_bar(conn, bar_index); } else if let Some(seat_index) = - state.seats.iter().position(|seat| seat.reg_name == name) + state.seats.iter().position(|seat| seat.reg_name == *name) { state.drop_seat(conn, seat_index); } |
