Bug 480198 - "Add to Panel (Widget)" is still shown on the context menu for apps in the Favorites view that are also pinned to the Task Manager
Summary: "Add to Panel (Widget)" is still shown on the context menu for apps in the Fa...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: master
Platform: Neon Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6, usability
Depends on:
Blocks:
 
Reported: 2024-01-23 01:37 UTC by guimarcalsilva
Modified: 2024-01-26 15:56 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description guimarcalsilva 2024-01-23 01:37:17 UTC
SUMMARY
The merge request https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3330 removed the "Add to Panel (widget)" context menu action for apps on Kickoff when a task manager is available because it was essentially doing the same as "Pin to Task Manager". However, it forgot to remove the same button for apps on the Favorites view.

STEPS TO REPRODUCE
1. Open Kickoff on the Favorites view (make sure to have a task manager like IOTM)
2. Right-click one of the applications there

OBSERVED RESULT
The "Add to Panel (widget)" context menu action is still available.

EXPECTED RESULT
It should be removed when a task manager is available, just like it was for apps on other categories on Kickoff.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 5.249.0
Qt Version: 6.6.1
Comment 1 Marco Martin 2024-01-23 11:26:00 UTC
the one thing i can reproduce, is that the apps that are already pinned to the task manager do have add to panel (widget) while the ones that are not pinned yet, have the pin to taskmanager entry

what should probably happen is the already pinned ones making the extra context menu they have on the panel, to either unpin if only one activity, or add to specific activity if more than one
Comment 2 Nate Graham 2024-01-23 17:56:44 UTC
Yeah, can reproduce but only for apps that are also pinned to the Task Manager. This is fairly silly IMO since for these apps there's even less of a reason to add them to the panel as a launcher.
Comment 3 Nate Graham 2024-01-23 18:09:41 UTC
I think the problem is that ContainmentInterface::mayAddLauncher() returns false here since the app is already pinned.

What we probably want is a function that returns whether it's *theoretically* possible to pin the app to a Task Manager, not whether it's *currently* possible to do it.
Comment 4 Bug Janitor Service 2024-01-24 14:33:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2000
Comment 5 Bug Janitor Service 2024-01-24 14:33:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3819
Comment 6 Bug Janitor Service 2024-01-25 09:30:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3826
Comment 7 Marco Martin 2024-01-26 15:48:58 UTC
Git commit 709dbb816d39cb0c6fbeb162031d6d6fc14e89ef by Marco Martin.
Committed on 26/01/2024 at 16:48.
Pushed by mart into branch 'master'.

Api to know whether an applet supportslaunchers

Right now when an app is already pinned to the taskmanager, kickoff
thinks as is not pinnable anymore, adding the icon widget to the
panel is still needed.

This removes both the pin and the add icon to panel actions when is already pinned

On the long term i would like to have the same per activity
context menu that the taskbar itself has, but since it would
be a more invasive change, should be at least for 6.1

Depends on https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3819 or https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3826
FIXED-IN: 6.0

M  +8    -0    applets/taskmanager/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/709dbb816d39cb0c6fbeb162031d6d6fc14e89ef
Comment 8 Marco Martin 2024-01-26 15:49:00 UTC
Git commit 7405d2c871f31a238036db560863be9a664355b0 by Marco Martin.
Committed on 26/01/2024 at 16:48.
Pushed by mart into branch 'master'.

Hide pin to taskmanager when already pinned

Right now when an app is already pinned to the taskmanager, kickoff
thinks as is not pinnable anymore, adding the icon widget to the
panel is still needed.

This removes both the pin and the add icon to panel actions when is already pinned

On the long term i would like to have the same per activity
context menu that the taskbar itself has, but since it would
be a more invasive change, should be at least for 6.1

M  +5    -2    applets/kicker/plugin/actionlist.cpp
M  +39   -3    applets/kicker/plugin/containmentinterface.cpp
M  +2    -0    applets/kicker/plugin/containmentinterface.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/7405d2c871f31a238036db560863be9a664355b0
Comment 9 Marco Martin 2024-01-26 15:56:05 UTC
Git commit 8fceb1e8f5fafd6689f6fc56997904cd3c441860 by Marco Martin.
Committed on 26/01/2024 at 16:55.
Pushed by mart into branch 'Plasma/6.0'.

Hide pin to taskmanager when already pinned

Right now when an app is already pinned to the taskmanager, kickoff
thinks as is not pinnable anymore, adding the icon widget to the
panel is still needed.

This removes both the pin and the add icon to panel actions when is already pinned

On the long term i would like to have the same per activity
context menu that the taskbar itself has, but since it would
be a more invasive change, should be at least for 6.1

M  +5    -2    applets/kicker/plugin/actionlist.cpp
M  +39   -3    applets/kicker/plugin/containmentinterface.cpp
M  +2    -0    applets/kicker/plugin/containmentinterface.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/8fceb1e8f5fafd6689f6fc56997904cd3c441860
Comment 10 Marco Martin 2024-01-26 15:56:53 UTC
Git commit 75c6a35a48fd112068209983507714484d3fa7a3 by Marco Martin.
Committed on 26/01/2024 at 16:56.
Pushed by mart into branch 'Plasma/6.0'.

Api to know whether an applet supportslaunchers

Right now when an app is already pinned to the taskmanager, kickoff
thinks as is not pinnable anymore, adding the icon widget to the
panel is still needed.

This removes both the pin and the add icon to panel actions when is already pinned

On the long term i would like to have the same per activity
context menu that the taskbar itself has, but since it would
be a more invasive change, should be at least for 6.1

Depends on https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3819 or https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3826
FIXED-IN: 6.0

M  +8    -0    applets/taskmanager/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/75c6a35a48fd112068209983507714484d3fa7a3