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

@ -5,7 +5,10 @@ use {
fixed::Fixed,
ifs::{
wl_seat::{tablet::TabletTool, NodeSeatState, WlSeatGlobal},
wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt},
wl_surface::{
tray::TrayItemId,
xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt},
},
xdg_positioner::{
XdgPositioned, XdgPositioner, CA_FLIP_X, CA_FLIP_Y, CA_RESIZE_X, CA_RESIZE_Y,
CA_SLIDE_X, CA_SLIDE_Y,
@ -41,6 +44,12 @@ pub trait XdgPopupParent {
fn output(&self) -> Rc<OutputNode>;
fn has_workspace_link(&self) -> bool;
fn post_commit(&self);
fn tray_item(&self) -> Option<TrayItemId> {
None
}
fn allow_popup_focus(&self) -> bool {
false
}
}
pub struct XdgPopup {
@ -392,6 +401,17 @@ impl XdgSurfaceExt for XdgPopup {
fn extents_changed(&self) {
self.xdg.surface.client.state.tree_changed();
}
fn focus_node(&self) -> Option<Rc<dyn Node>> {
if self.parent.get()?.allow_popup_focus() {
return Some(self.xdg.surface.clone());
}
None
}
fn tray_item(&self) -> Option<TrayItemId> {
self.parent.get()?.tray_item()
}
}
#[derive(Debug, Error)]