Skip to content

Commit

Permalink
tree: damage stacked nodes when visibility changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Jul 15, 2024
1 parent d1893a6 commit fcaed80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ifs/wl_surface/x_surface/xwindow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ impl StackedNode for Xwindow {
stacked_node_impl!();

fn stacked_set_visible(&self, visible: bool) {
let extents = self.x.surface.extents.get();
let (x, y) = self.x.surface.buffer_abs_pos.get().position();
self.data.state.damage(extents.move_(x, y));
self.tl_set_visible(visible);
}

Expand Down
5 changes: 5 additions & 0 deletions src/ifs/wl_surface/xdg_surface/xdg_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ impl XdgPopupRequestHandler for XdgPopup {

impl XdgPopup {
pub fn set_visible(&self, visible: bool) {
let surface = &self.xdg.surface;
let extents = surface.extents.get();
let (x, y) = surface.buffer_abs_pos.get().position();
surface.client.state.damage(extents.move_(x, y));

// log::info!("set visible = {}", visible);
self.set_visible_prepared.set(false);
self.xdg.set_visible(visible);
Expand Down
4 changes: 3 additions & 1 deletion src/tree/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ impl StackedNode for FloatNode {
stacked_node_impl!();

fn stacked_set_visible(&self, visible: bool) {
self.visible.set(visible);
if self.visible.replace(visible) != visible {
self.state.damage(self.position.get());
}
if let Some(child) = self.child.get() {
child.tl_set_visible(visible);
}
Expand Down

0 comments on commit fcaed80

Please sign in to comment.