summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorMaxVerevkin <maxxverrr@gmail.com>2023-03-23 18:49:47 +0200
committerMaxVerevkin <maxxverrr@gmail.com>2023-03-23 19:01:49 +0200
commit210991f37fca6c4ae94979356ae8e55e048c232e (patch)
tree4e1fef8b8e6515ef8a775a0111fbf6e26c32e3cf /src/state.rs
parente195a50d75c394a69a7228f8c1e5ad320c3ad06d (diff)
downloadi3bar-mango-210991f37fca6c4ae94979356ae8e55e048c232e.tar.gz
update dependencies
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs17
1 files changed, 6 insertions, 11 deletions
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);
}