Bug 415917 - The context menu when dropping a file to the desktop corner doesn't appear correctly
Summary: The context menu when dropping a file to the desktop corner doesn't appear co...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.17.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-06 03:31 UTC by trmdi
Modified: 2020-02-04 17:04 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trmdi 2020-01-06 03:31:55 UTC
STEPS TO REPRODUCE
1. Drop a file to the right bottom desktop corner.

OBSERVED RESULT
- Screenshot: https://i.imgur.com/3U5whin.png

EXPECTED RESULT
- It should appear like how the right click context menu does, screenshot: https://i.imgur.com/P4qt4L6.png
Comment 1 Noah Davis 2020-01-06 05:26:25 UTC
I can reproduce this.
Comment 3 trmdi 2020-01-13 12:35:10 UTC
Git commit fbb2be9aad196d92ca1a7adcc8afa8b63ba83659 by Tranter Madi.
Committed on 13/01/2020 at 12:34.
Pushed by trmdi into branch 'master'.

Add KIO::DropJobFlag to allow manually showing the menu

Summary:
This patch allows the application to manually popup the menu by using the `KIO::ShowMenuManually` flag with the `DropJob::showMenu()` method.

Test Plan: Can't reproduce the bug with this patch.

Reviewers: #frameworks, davidedmundson, elvisangelaccio, mart, dfaure

Reviewed By: dfaure

Subscribers: ngraham, broulik, anthonyfieroni, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26484

M  +29   -5    src/widgets/dropjob.cpp
M  +37   -0    src/widgets/dropjob.h

https://commits.kde.org/kio/fbb2be9aad196d92ca1a7adcc8afa8b63ba83659
Comment 4 Christoph Feck 2020-01-20 13:05:37 UTC
Tranter, could you please add a clarification which issue remains after the recent commit? https://phabricator.kde.org/D26691 looks related, but only seems an optimization?
Comment 5 trmdi 2020-01-20 13:22:52 UTC
(In reply to Christoph Feck from comment #4)
> Tranter, could you please add a clarification which issue remains after the
> recent commit? https://phabricator.kde.org/D26691 looks related, but only
> seems an optimization?

Yes, the above commit only add the new method in KIO::DropJob.
Plasma need to make use of it to fix this bug but it hasn't yet.
Comment 6 trmdi 2020-01-20 13:28:03 UTC
Maybe I shouldn't have added the BUG: line in the patch above. Sorry.
Comment 7 Christoph Feck 2020-01-20 13:33:12 UTC
Thanks for the clarification. You can use CCBUG: ###### in commit messages to reference a bug without closing it.
Comment 8 trmdi 2020-02-04 05:54:55 UTC
Git commit f8be3ea7102fbd584da1a39f5285ca72b5e69afa by Tranter Madi.
Committed on 04/02/2020 at 05:54.
Pushed by trmdi into branch 'master'.

Optimize code when dropping files into the desktop

Summary:
Currently, when you have the desktop in the Desktop layout, if you drop 10 jpg files into the desktop, it creates 10 menus at the same position.
When you have the desktop in the Folder layout, if you drop 10 jpg files into the desktop, it calls `KIO::setApplicationActions()` 10 times.

What does this improve?

- Do not create KIO::MimetypeJob for each file
- Do not call `DropJob::setApplicationActions()` too many times/ create too many menus for each file.

My idea is that, when you drop files into the desktop:
- If they have the same `mimetype` -> we add actions support this `mimetype`.
- If not -> we only show the action from `KIO::DropJob` and only actions support different `mimetypes` at the same time like `Add icon`...

**Require:** D26484

Reviewers: #plasma, mart, broulik, #vdg, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26691

M  +95   -152  src/scriptengines/qml/plasmoid/containmentinterface.cpp
M  +2    -4    src/scriptengines/qml/plasmoid/containmentinterface.h
A  +110  -0    src/scriptengines/qml/plasmoid/dropmenu.cpp     [License: LGPL (v2+)]
A  +66   -0    src/scriptengines/qml/plasmoid/dropmenu.h     [License: LGPL (v2+)]

https://commits.kde.org/plasma-framework/f8be3ea7102fbd584da1a39f5285ca72b5e69afa
Comment 9 trmdi 2020-02-04 05:55:55 UTC
Git commit 36e918b0978076359c17c70c136bd27862db9d63 by Tranter Madi.
Committed on 04/02/2020 at 05:55.
Pushed by trmdi into branch 'master'.

Delay popup when dropping things into containments

Summary:
Depend: D26691

Test Plan: Drop files into desktop folder layout/folder widget, the menu is shown correctly in all cases.

Reviewers: #plasma, davidedmundson, broulik, hein

Reviewed By: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26514

M  +2    -2    containments/desktop/package/contents/ui/FolderView.qml
M  +3    -2    containments/desktop/plugins/folder/foldermodel.cpp
M  +1    -1    containments/desktop/plugins/folder/foldermodel.h

https://commits.kde.org/plasma-desktop/36e918b0978076359c17c70c136bd27862db9d63