Bug 449711 - Dragging Folder View items over sticky note makes them all disappear except one (until restart)
Summary: Dragging Folder View items over sticky note makes them all disappear except o...
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: notes (show other bugs)
Version: master
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-06 18:19 UTC by ratijas
Modified: 2022-02-10 21:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.1
Sentry Crash Report:


Attachments
Plasma desktop containment - disappearing icons and binding loop in FolderItemDelegate for verticalAlignment (1.44 MB, video/mp4)
2022-02-06 18:19 UTC, ratijas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ratijas 2022-02-06 18:19:18 UTC
Created attachment 146351 [details]
Plasma desktop containment - disappearing icons and binding loop in FolderItemDelegate for verticalAlignment

SUMMARY

When moving a grid [at least 2x2 worth] of items like files and folders on a desktop containment configured (by default) as a folder view, all items except one would disappear upon mouse key release, and there would be lots of binding loops warning printed to a terminal.

Either this is something recent, or I just never had so many files on a desktop at once that I'd need to move them in a grid.

I suspected «positioner: Fix deferred move with multiple items»[1] patch at first, but Severin von Wnuck @medusalix tried Plasma 5.24 without that patch and confirmed the bug still exists.

STEPS TO REPRODUCE
1. Put at least 4 files on your desktop.
2. Arrange them in a grid with at least 2 rows and 2 columns.
3. Select all of them.
4. Drag to a new place on a desktop.

OBSERVED RESULT
One item remains, others disappear. Binding loop warnings are printed to a terminal.

EXPECTED RESULT
It should normally drag and drop.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970M/PCIe/SSE2

plasma-desktop: 963b4ee7a1c56ee68a2d5bf0557862d497fea974
plasma-workspace: daed0461ebafe1c70821f6852394b058078d3315
plasma-framework: 850051e0a0b577e6c22b67e2ba04a7c8c8ed25cb

ADDITIONAL INFORMATION

[1]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/836
Comment 1 ratijas 2022-02-06 18:38:48 UTC
Actually, might happen with a single row of multiple items as well.
Comment 2 Severin von Wnuck-Lipinski 2022-02-06 18:51:03 UTC
It seems like it has something to do with the Sticky Notes widget. If I drop icons near that widget they disappear entirely.
Comment 3 ratijas 2022-02-06 18:54:23 UTC
> It seems like it has something to do with the Sticky Notes widget. If I drop icons near that widget they disappear entirely.

Or even just dragging around and over it but dropping in entirely different place far away from it
Comment 4 Severin von Wnuck-Lipinski 2022-02-06 20:03:11 UTC
I think I've found the culprit:

https://invent.kde.org/plasma/kdeplasma-addons/-/blob/2c39c2051d9c7fc9e2e5c28c1d0ed44ea582ccd6/applets/notes/package/contents/ui/main.qml#L354

If you remove that line the text area won't get focused anymore if you drag items over the notes widget. But it resolves the disappearing icons issue.
Comment 5 ratijas 2022-02-06 21:00:54 UTC
> I think I've found the culprit:
> If you remove that line the text area won't get focused anymore if you drag items over the notes widget. But it resolves the disappearing icons issue.

Great job! Now, I don't have much experience with drag & drop in QML, and I wonder why that manual focusing is even needed?

AFAICT all other apps handle this by just drawing a cursor without focusing the text field when you drag something over it; and if you release inside, it would insert the content, and then depending on a GUI framework some apps will even set focus to this text field.
Comment 6 Nate Graham 2022-02-07 04:57:11 UTC
Indeed, seems unnecessary.

Wanna test out removing to make sure nothing breaks, and then submit a merge request for it?
Comment 7 Bug Janitor Service 2022-02-07 20:13:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/113
Comment 8 Severin von Wnuck-Lipinski 2022-02-07 21:45:32 UTC
Git commit cd39585efa070291964db3e2d45319bc1ee34e06 by Severin von Wnuck.
Committed on 07/02/2022 at 20:12.
Pushed by ngraham into branch 'master'.

[applets/notes] Fix drag-and-drop focus stealing

The sticky note widget focuses the text area when dragging desktop icons
over the widget. This can cause the desktop icons to disappear once they
are dropped on the desktop.

M  +0    -1    applets/notes/package/contents/ui/main.qml

https://invent.kde.org/plasma/kdeplasma-addons/commit/cd39585efa070291964db3e2d45319bc1ee34e06
Comment 9 Nate Graham 2022-02-07 21:50:32 UTC
Git commit e6fc3c0015dc18ea0c901480c1fe5db86b0a2396 by Nate Graham, on behalf of Severin von Wnuck.
Committed on 07/02/2022 at 21:50.
Pushed by ngraham into branch 'Plasma/5.24'.

[applets/notes] Fix drag-and-drop focus stealing

The sticky note widget focuses the text area when dragging desktop icons
over the widget. This can cause the desktop icons to disappear once they
are dropped on the desktop.


(cherry picked from commit cd39585efa070291964db3e2d45319bc1ee34e06)

M  +0    -1    applets/notes/package/contents/ui/main.qml

https://invent.kde.org/plasma/kdeplasma-addons/commit/e6fc3c0015dc18ea0c901480c1fe5db86b0a2396