Summary: | Icons created on second monitor extending containment. | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Oleg Solovyov <mcpain> |
Component: | Folder | Assignee: | Eike Hein <hein> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, plasma-bugs |
Priority: | NOR | ||
Version: | 5.21.4 | ||
Target Milestone: | 1.0 | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-desktop/commit/2b7b0c5419455a16425fc06e25cce2cd1f434121 | Version Fixed In: | 5.21.5 |
Sentry Crash Report: | |||
Attachments: | screenshot |
Description
Oleg Solovyov
2021-04-26 13:53:58 UTC
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 |