diff --git a/src/ifs/wl_surface/x_surface/xwindow.rs b/src/ifs/wl_surface/x_surface/xwindow.rs index 49110421..43755334 100644 --- a/src/ifs/wl_surface/x_surface/xwindow.rs +++ b/src/ifs/wl_surface/x_surface/xwindow.rs @@ -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); } diff --git a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs index 05d58c8a..cf25578a 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs @@ -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); diff --git a/src/tree/float.rs b/src/tree/float.rs index 1fc4350f..11929502 100644 --- a/src/tree/float.rs +++ b/src/tree/float.rs @@ -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); }