Skip to content

Drop overlay not dismissed after drag-and-drop file import #1044

@jrlomas

Description

@jrlomas

When dragging and dropping an audiobook file onto Cozy, the "Drop Audio Books Here to Add Them to Your Library" overlay appears correctly. However, after releasing the file (completing the drop), the overlay never disappears. The screen remains blurred with the drop overlay visible.

Steps to Reproduce
Open Cozy
Drag an audiobook file (e.g., .m4b, .mp3) from a file manager onto the Cozy window
The drop overlay appears with "Drop Audio Books Here..." message
Release/drop the file
Bug: The overlay stays visible and the background remains blurred
Expected Behavior
The drop overlay should disappear and the blur should be removed after the file is dropped, similar to when the drag exits the window without dropping.

Actual Behavior
The overlay persists indefinitely after a successful drop. The file is imported correctly in the background, but the UI is stuck showing the drop overlay.

Root Cause
In main_view.py, the _on_drag_data_received handler starts the file copy thread but doesn't hide the drop overlay. The _on_drag_leave callback only fires when drag exits without dropping, not on a successful drop.

Suggested Fix

--- a/cozy/ui/main_view.py
+++ b/cozy/ui/main_view.py
@@ -286,6 +286,9 @@ class CozyUI(EventSender, metaclass=Singleton):
         return True
 
     def _on_drag_data_received(self, widget, value, *_):
+        self.drop_revealer.set_reveal_child(False)
+        self.main_stack.remove_css_class("blurred")
+
         thread = Thread(target=self._files.copy, args=[value.get_files()], name="DnDImportThread")
         thread.start()
         return True

Environment
Cozy version: 1.3.0
OS: Linux Mint 22.2 (also reported on other distributions)
Installation: Flatpak

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions