Unset drop_target after success, or close

This commit is contained in:
Ian Douglas Scott 2024-05-08 13:47:42 -07:00
parent 7176623193
commit a014d8ca3d

View file

@ -288,6 +288,7 @@ impl App {
fn hide(&mut self) -> Command<cosmic::app::Message<Msg>> { fn hide(&mut self) -> Command<cosmic::app::Message<Msg>> {
self.visible = false; self.visible = false;
self.update_capture_filter(); self.update_capture_filter();
self.drag_surface = None;
Command::batch( Command::batch(
mem::take(&mut self.layer_surfaces) mem::take(&mut self.layer_surfaces)
.into_keys() .into_keys()
@ -541,11 +542,11 @@ impl Application for App {
.ok() .ok()
.and_then(|s| u32::from_str(s).ok()); .and_then(|s| u32::from_str(s).ok());
if let Some((_, DragSurface::Toplevel { handle, .. }, _)) = &self.drag_surface { if let Some((_, DragSurface::Toplevel { handle, .. }, _)) = &self.drag_surface {
if let Some(drop_target) = &self.drop_target { if let Some(drop_target) = self.drop_target.take() {
self.send_wayland_cmd(backend::Cmd::MoveToplevelToWorkspace( self.send_wayland_cmd(backend::Cmd::MoveToplevelToWorkspace(
handle.clone(), handle.clone(),
drop_target.0.clone(), drop_target.0,
drop_target.1.clone(), drop_target.1,
)); ));
} }
} }