Bug 468148 - The right click on the desktop should give same result that in dolphin and should use action .desktop file.
Summary: The right click on the desktop should give same result that in dolphin and sh...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 5.27.3
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-04 12:57 UTC by Nils Beaussé
Modified: 2023-04-06 11:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Beaussé 2023-04-04 12:57:36 UTC
In plasma, the behaviour of the right click on the desktop is hardcoded in :
https://invent.kde.org/plasma/plasma-workspace/-/tree/master/containmentactions

To resemble and have certain functionalities of the dolphin counterpart coded here : 

https://invent.kde.org/system/dolphin/-/blob/master/src/dolphincontextmenu.cpp#L300
https://invent.kde.org/frameworks/kio/-/blob/master/src/widgets/kfileitemactions.cpp#L246

But the mimic is not perfect and lack feature. Most notably, the main feature missing is the absence of taken into account the .desktop files which describe specific action for the Dolphin menu and which are the generic way to modify this menu. For exemple, the open terminal is hardcoded (and not in the same way of Dolphin which open a terminal HERE).

The functionality should be, in my opinion : 

- Same behaviour of the Dolphin counterpart menu in regard to the defined actions .desktop files.
+ the specifics of the desktop (add a panel etc.)

Ideally, it could be a good idea to find a way to factorize the two part of the code in a way where all the « not desktop » part are coded in the same place as the dolphin part.
Well, the two menus should be composed of a specific parts for dolphin and for the desktop and of a common part (copy, past, cancel, new, actions etc.).

In addition to that point, it could be a good idea to defined a MIME type that apply specifically to the desktop in the .desktop file.

  Thanks for reading ;)
Comment 1 Nate Graham 2023-04-04 17:52:58 UTC
Yes, it's a good idea. But where should the code live? Dolphin and Plasma are different products and have different release schedules. So all of the code that's common to both of them would have to live in a library that both can use, perhaps one of the KDE frameworks like KIO.
Comment 2 Nils Beaussé 2023-04-06 11:54:46 UTC
(In reply to Nate Graham from comment #1)
> Yes, it's a good idea. But where should the code live? Dolphin and Plasma
> are different products and have different release schedules. So all of the
> code that's common to both of them would have to live in a library that both
> can use, perhaps one of the KDE frameworks like KIO.

I think it could be in a specific common lib. This is a common practice for big software to have some common files between projects. It could also be simple C++ files that are shared between project, not necessarily a compiled library.  

Imho, the modification is relatively simple for the menu, but can be extended to other things that are shared between the two.