SUMMARY Using KDE Neon on a PC with two monitors connected. Icons arrangement is set to "Columns" STEPS TO REPRODUCE 1. Log in 2. Create a file on second monitor 3. Be shocked that file isn't created OBSERVED RESULT Notice the scrollbar below (see screenshot) EXPECTED RESULT The file is created in correct place. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.4.0 KDE Plasma Version: 5.21.4 KDE Frameworks Version: 5.82.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION X11 is used When arrangement is Rows, it works fine When the file is created on first monitor, it works fine Same with folder creation
Probably breaks after 5.20 release
It breaks after e8f0ded578183a375be205086f689455f52e54bf
(In reply to Oleg Solovyov from comment #2) > It breaks after e8f0ded578183a375be205086f689455f52e54bf seems like there is something else, digging further
(In reply to Oleg Solovyov from comment #3) > (In reply to Oleg Solovyov from comment #2) > > It breaks after e8f0ded578183a375be205086f689455f52e54bf > seems like there is something else, digging further QCursor::pos() is used for determining which place will be used for a new icon. But if we have two 1920x1080 monitors, pos() will return something like QPoint(2673, 438). Hence the icon is created outside of the view.
Created attachment 137956 [details] screenshot
Hmm, seems like either a Qt bug, or we're using it wrong.
(In reply to Nate Graham from comment #6) > Hmm, seems like either a Qt bug, or we're using it wrong. I think we're using it wrong. Clicking the left-top corner of the second screen would return (1920,0) instead of correct (0,0) QCursor::pos() Returns the position of the cursor (hot spot) of the screen in global screen coordinates. `---------------,---------------` | | | | | | | | *(2400, 400)| | | | | | | ,---------------`---------------,
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/444
Git commit a13b176e673c6a3289bc7ff34b664c6138ce73eb by Oleg Solovyov. Committed on 28/04/2021 at 08:38. Pushed by ngraham into branch 'master'. Calculate cursor position relative to top-left corner of current screen QCursor::pos() returns an absolute position of cursor, which is incorrect unless the screen's top-left corner is (0, 0). This is used when calculating position of the icon created on desktop. M +18 -1 containments/desktop/plugins/folder/foldermodel.cpp M +1 -0 containments/desktop/plugins/folder/foldermodel.h https://invent.kde.org/plasma/plasma-desktop/commit/a13b176e673c6a3289bc7ff34b664c6138ce73eb
Git commit 2b7b0c5419455a16425fc06e25cce2cd1f434121 by Nate Graham, on behalf of Oleg Solovyov. Committed on 28/04/2021 at 16:38. Pushed by ngraham into branch 'Plasma/5.21'. Calculate cursor position relative to top-left corner of current screen QCursor::pos() returns an absolute position of cursor, which is incorrect unless the screen's top-left corner is (0, 0). This is used when calculating position of the icon created on desktop. (cherry picked from commit a13b176e673c6a3289bc7ff34b664c6138ce73eb) M +18 -1 containments/desktop/plugins/folder/foldermodel.cpp M +1 -0 containments/desktop/plugins/folder/foldermodel.h https://invent.kde.org/plasma/plasma-desktop/commit/2b7b0c5419455a16425fc06e25cce2cd1f434121