1
0
Fork 0
forked from wry/wry

tree: make surface visibility tracking more robust

This commit is contained in:
Julian Orth 2024-03-29 20:07:28 +01:00
parent be0935c8dd
commit ba98103233
26 changed files with 313 additions and 144 deletions

View file

@ -47,6 +47,7 @@ pub struct XdgPopup {
pos: RefCell<XdgPositioned>,
pub tracker: Tracker<Self>,
seat_state: NodeSeatState,
set_visible_prepared: Cell<bool>,
}
impl Debug for XdgPopup {
@ -77,6 +78,7 @@ impl XdgPopup {
pos: RefCell::new(pos),
tracker: Default::default(),
seat_state: Default::default(),
set_visible_prepared: Cell::new(false),
})
}
@ -243,6 +245,7 @@ impl XdgPopup {
pub fn set_visible(&self, visible: bool) {
// log::info!("set visible = {}", visible);
self.set_visible_prepared.set(false);
self.xdg.set_visible(visible);
self.seat_state.set_visible(self, visible);
}
@ -340,8 +343,20 @@ impl Node for XdgPopup {
impl StackedNode for XdgPopup {
stacked_node_impl!();
fn stacked_prepare_set_visible(&self) {
self.set_visible_prepared.set(true);
}
fn stacked_needs_set_visible(&self) -> bool {
self.set_visible_prepared.get()
}
fn stacked_set_visible(&self, visible: bool) {
self.xdg.set_visible(visible);
self.set_visible(visible);
}
fn stacked_has_workspace_link(&self) -> bool {
self.workspace_link.borrow().is_some()
}
fn stacked_absolute_position_constrains_input(&self) -> bool {

View file

@ -389,6 +389,7 @@ impl XdgToplevel {
}
self.toplevel_data.detach_node(self);
self.xdg.detach_node();
self.tl_set_visible(self.state.root_visible());
}
pub fn after_toplevel_drag(self: &Rc<Self>, output: &Rc<OutputNode>, x: i32, y: i32) {