Bug 481254 - Desktop files/folders dropped from one screen onto another one disappear until plasmashell is restarted or the other screen is disconnected/reconnected
Summary: Desktop files/folders dropped from one screen onto another one disappear unti...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 5.93.0
Platform: Arch Linux Linux
: VHI major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: multiscreen, qt6
Depends on:
Blocks:
 
Reported: 2024-02-12 09:26 UTC by groomyrocky
Modified: 2024-03-06 18:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description groomyrocky 2024-02-12 09:26:52 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. upgrade to KDE6 with existing desktop icons
2. move icons from first monitor desktop to second monitor desktop
3. 

OBSERVED RESULT
icons disappear but can still accessed through desktop directory 

EXPECTED RESULT
show on the second monitor's desktop

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: arch linux, KDE6
(available in About System)
KDE Plasma Version: 6 RC2
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Doug 2024-02-17 03:33:41 UTC
Can reproduce.  Icons don't have to be there during upgrade to KDE6.  You can add icons and move them and reproduce.

Operating System: KDE neon Testing Edition
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.1
Kernel Version: 6.5.0-18-generic (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Pro WX 3200 Series
Comment 2 Nate Graham 2024-02-23 21:01:58 UTC
Aaaaa can reproduce
Comment 3 Nate Graham 2024-02-23 21:04:36 UTC
If I restart plasmashell, the file appears on the external screen in the position I dragged it to.

If instead, I disconnect the screen that I dragged the file onto, it re-appears on the original screen, but in the top-left-most position, not where it was before.

If I then re-connect the external screen, the file appears on its desktop in the top-left-most position.
Comment 4 Bug Janitor Service 2024-02-26 16:19:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2069
Comment 5 Marco Martin 2024-02-28 08:49:33 UTC
Git commit f0ede2d83731952012be0d43c77916d18617edb2 by Marco Martin.
Committed on 28/02/2024 at 08:49.
Pushed by mart into branch 'master'.

FolderView Positioner: fix rows insert and remove

The positioner "proxy" model had problems both in rows insertion and
removal.

when an icon is dropped in an empty desktop area as the new "last"
position, the positioner model creates new empty items for the GridView
until it reaches the cell of the drop position.

This broke because of connection slot invocation order: the connection
to QAbstractItemModel::rowsInserted in FolderModel constructor was
executed before the connection in positioner.
In turn that connection emitted move, which invoked move on Positioner,
which at this point thinks its still in the first rows insertion
transaction, because its slot has not been executed yet,
and m_beginInsertRowsCalled is still true, so there won't be a "correct"
new beginInsertRows called.
Make it a Queued connection to push it back.

In the same way, when dragging from a "last" position, the Positioner model
will remove all the trailing empty items. But it modified m_proxyToSource
(from which rowCount() depends) before calling beginRemoveRows, sending
the model into an inconsitent state and causing an assert. Make sure
that m_proxyToSource is touched only after beginRemoveRows.
Related: bug 466337

M  +18   -11   containments/desktop/plugins/folder/foldermodel.cpp
M  +11   -6    containments/desktop/plugins/folder/positioner.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/f0ede2d83731952012be0d43c77916d18617edb2
Comment 6 Marco Martin 2024-02-28 08:51:01 UTC
Git commit e306c63ddbeaccea72a03fbb2c3dbd8245addef5 by Marco Martin.
Committed on 28/02/2024 at 08:50.
Pushed by mart into branch 'Plasma/6.0'.

FolderView Positioner: fix rows insert and remove

The positioner "proxy" model had problems both in rows insertion and
removal.

when an icon is dropped in an empty desktop area as the new "last"
position, the positioner model creates new empty items for the GridView
until it reaches the cell of the drop position.

This broke because of connection slot invocation order: the connection
to QAbstractItemModel::rowsInserted in FolderModel constructor was
executed before the connection in positioner.
In turn that connection emitted move, which invoked move on Positioner,
which at this point thinks its still in the first rows insertion
transaction, because its slot has not been executed yet,
and m_beginInsertRowsCalled is still true, so there won't be a "correct"
new beginInsertRows called.
Make it a Queued connection to push it back.

In the same way, when dragging from a "last" position, the Positioner model
will remove all the trailing empty items. But it modified m_proxyToSource
(from which rowCount() depends) before calling beginRemoveRows, sending
the model into an inconsitent state and causing an assert. Make sure
that m_proxyToSource is touched only after beginRemoveRows.
Related: bug 466337

M  +18   -11   containments/desktop/plugins/folder/foldermodel.cpp
M  +11   -6    containments/desktop/plugins/folder/positioner.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/e306c63ddbeaccea72a03fbb2c3dbd8245addef5
Comment 7 Dashon 2024-03-04 12:15:09 UTC
I seem to be once again having this issue on plasma 6. I'm using arch's testing repositories, so that may be the issue. Can anyone confirm that there haven't been any regressions?
Comment 8 Dashon 2024-03-04 12:17:05 UTC
Sorry, I didn't check the date. The solution was rather recent and most likely isn't in a current release yet. My apologies for reopening this.
Comment 9 Dashon 2024-03-06 18:33:10 UTC
It is fixed in  6.0.1, although I do see it briefly appear on the previous monitor before jumping to the monitor that you dragged it to. I'll file a different report for that though.