Bug 468148

Summary: The right click on the desktop should give same result that in dolphin and should use action .desktop file.
Product: [Plasma] plasmashell Reporter: Nils Beaussé <nils_beausse>
Component: FolderAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: wishlist CC: hein, nate, notmart
Priority: NOR    
Version: 5.27.3   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=459033
https://bugs.kde.org/show_bug.cgi?id=448799
https://bugs.kde.org/show_bug.cgi?id=451214
https://bugs.kde.org/show_bug.cgi?id=451215
https://bugs.kde.org/show_bug.cgi?id=450688
https://bugs.kde.org/show_bug.cgi?id=312330
Latest Commit: Version Fixed In:

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.