From 210991f37fca6c4ae94979356ae8e55e048c232e Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Thu, 23 Mar 2023 18:49:47 +0200 Subject: update dependencies --- src/bar.rs | 2 +- src/shared_state.rs | 2 +- src/state.rs | 17 ++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/bar.rs b/src/bar.rs index 90eae29..811ac0d 100644 --- a/src/bar.rs +++ b/src/bar.rs @@ -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: &mut State, - _: WlRegistry, - event: wl_registry::Event, -) { +fn wl_registry_cb(conn: &mut Connection, state: &mut State, event: &wl_registry::Event) { match event { wl_registry::Event::Global(global) if global.is::() => { 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); } -- cgit v1.3.1