tree: make surface visibility tracking more robust
This commit is contained in:
parent
be0935c8dd
commit
ba98103233
26 changed files with 313 additions and 144 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue