1
0
Fork 0
forked from wry/wry

wayland: implement jay-tray-v1

This commit is contained in:
Julian Orth 2024-10-17 16:05:19 +02:00
parent 18bddbc987
commit 8c3cd97ae3
28 changed files with 979 additions and 43 deletions

View file

@ -47,6 +47,7 @@ use {
SeatIds, WlSeatGlobal,
},
wl_surface::{
tray::TrayItemIds,
wl_subsurface::SubsurfaceIds,
zwp_idle_inhibitor_v1::{IdleInhibitorId, IdleInhibitorIds, ZwpIdleInhibitorV1},
zwp_input_popup_surface_v2::ZwpInputPopupSurfaceV2,
@ -222,6 +223,7 @@ pub struct State {
pub ui_drag_threshold_squared: Cell<i32>,
pub toplevels: CopyHashMap<ToplevelIdentifier, Weak<dyn ToplevelNode>>,
pub const_40hz_latch: EventSource<dyn LatchListener>,
pub tray_item_ids: TrayItemIds,
}
// impl Drop for State {
@ -586,7 +588,10 @@ impl State {
self.globals.add_global(self, global)
}
pub fn remove_global<T: RemovableWaylandGlobal>(&self, global: &T) -> Result<(), GlobalsError> {
pub fn remove_global<T: RemovableWaylandGlobal>(
&self,
global: &Rc<T>,
) -> Result<(), GlobalsError> {
self.globals.remove(self, global)
}
@ -1254,6 +1259,10 @@ impl State {
}
}
}
pub fn tray_icon_size(&self) -> i32 {
(self.theme.sizes.title_height.get() - 2).max(0)
}
}
#[derive(Debug, Error)]