use smithay_client_toolkit::{ reexports::client::QueueHandle, shm::{slot::SlotPool, ShmState}, }; use crate::{ config::Config, i3bar_protocol::Block, state::{ComputedBlock, State}, status_cmd::StatusCmd, }; #[derive(Debug)] pub struct SharedState { pub qh: QueueHandle, pub shm_state: ShmState, pub pool: Option, pub config: Config, pub status_cmd: Option, pub blocks: Vec, pub blocks_cache: Vec, } impl SharedState { pub fn get_pool(&mut self, len: usize) -> &mut SlotPool { self.pool.get_or_insert_with(|| { SlotPool::new(len, &self.shm_state).expect("Failed to create pool") }) } }