Disable dynamic context menu in task bar

Hi All,
I’d like to submit the following patch to disable dynamic context menu in task bar. For some applications that menu’s recent files and actions can be large and wide taking up a third of the screen’s real estate.
Can we add this run time configuration option to disable it?
I’d like to hear your thoughts. Maybe we can split it to two options: recent files and actions?
Thank you!
PS: The patch is versus plasma-desktop 6.2.5.

diff -r ~/projects/plasma-desktop/applets/taskmanager/package/contents/ /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/
diff '--color=auto' -r /home/local/projects/plasma-desktop/applets/taskmanager/package/contents/config/main.xml /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml
142a143,146
>     <entry name="showDynamicContextMenu" type="Bool">
>       <label>show dynamic context menu (recent files, ...).</label>
>       <default>false</default>
>     </entry>
diff '--color=auto' -r /home/local/projects/plasma-desktop/applets/taskmanager/package/contents/ui/ConfigBehavior.qml /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/ConfigBehavior.qml
35a36
>     property alias cfg_showDynamicContextMenu: showDynamicContextMenu.checked
257a259,272
> 
> 
>         Item {
>             Kirigami.FormData.isSection: true
>         }
> 
>         // dynamic context menu
>         QQC2.CheckBox {
>             id: showDynamicContextMenu
>             visible: true
>             text: i18nc("@option:show dynamic context menu (recent files, ...)", "show dynamic context menu (recent files, ...)")
>             enabled: true
>         }
> 
diff '--color=auto' -r /home/local/projects/plasma-desktop/applets/taskmanager/package/contents/ui/ContextMenu.qml /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/ContextMenu.qml
75c75,76
<         loadDynamicLaunchActions(get(atm.LauncherUrlWithoutIcon));
---
>         if (Plasmoid.configuration.showDynamicContextMenu)
>             loadDynamicLaunchActions(get(atm.LauncherUrlWithoutIcon));

What’s the use case for wanting to disable this feature? It’s not visible until you right-click an app icon, right?

Hi @ngraham ,
Yes, you see this menu when you right click the application window (or icon?) in the task bar.
I guess the requirement comes from 3 things:

  1. Incorrect recent files - e.g. In firefox I get a list of files/URLs which I did not visit recently
  2. long file names in recent files - again in firefox URLs can be quite long
  3. unhelpful dynamic actions - I personally never used dynamic actions, maybe relevant to others as well.

What do you think about it?
How can we push this patch forward and see it incorporated into the code?
Thank you!

Hi - thanks for describing what you’ve run into! I would think, though, that rather than forcibly disabling a useful feature because of issues in its components, the issues in the components should be fixed :slight_smile:

Are those issues that you described already included in bug reports for their respective projects? For example, I don’t know if Plasma infers a recent file list for Firefox, or if Firefox provides that to Plasma, but it sounds whichever process happens isn’t working correctly.

Hi @johnandmegh ,
thank you for your reply.
We simply give the user the option to disable this feature.
Obviously I’m not the only one to request it - see reddit r/kde/comments/zfnwv2/remove_recent_files_media_controls_when_using/
I have not checked if this bug was reported to firefox. In any case, I saw this problem in other applications as well (audacious comes to mind).
Another issue is soft privacy - think personal vs. work web pages on a work computer - you wouldnt always want to expose the recent files (or URLs).
I think the idea of disabling recent files is valid since we already have it for the application menu.

Do you see any problem adding this feature to disable dynamic items or recent files?
Thank you.

I do, and I’ve been trying hard to not mention it, but since you’ve asked: Maintenance.

Task manager breaks kinda a lot already. I’ve been gearing up to beta-test KDE 6.3 for this exact reason, I expect it to break again because it does, EVERY time. Like literally every new release for the past 2 years I’ve filed a bug against Task Manager. It’s literally only been fully working in KDE 6 since a few weeks ago (2024-12-07). I say “fully working”, assuming there aren’t any more bugs, which I don’t know about. So, threads like this make me nervous :wink:

It’s a super important super high-traffic bit of UI, so even minor features can be super important and good to have, but also, more moving parts are not to be taken lightly, because breakages are also super important and bad to have.

Just to demonstrate: You forgot the icons and text task manager.
To be clear, this is not a request or suggestion that you should patch that, too, it’s a suggestion that you should consider the consequences of having more moving parts to maintain.

In addition to the maintenance problem, this should also highlight an important consideration - are you actually fixing the problem? Or are you fixing something else which isn’t actually broken?
For an analogy, if you have squeaky brakes on your car, you can easily “fix” that by simply removing the brakes…

Incorrect recent files - e.g. In firefox I get a list of files/URLs which I did not visit recently

That’s a problem with your system, it should work as you’d expect, where the recent files are …yknow, recent. Even if the files aren’t the correct ones, removing them is not the solution.

long file names in recent files - again in firefox URLs can be quite long

There’s a limit to this width, and if it’s too long, it’ll elide the entr…
If this is an issue, the correct fix is obviously to change the handling of the width of those entries, not to just delete them.

Another issue is soft privacy - think personal vs. work web pages on a work computer - you wouldnt always want to expose the recent files (or URLs).

There are no personal pages on a work computer but let’s say it’s pages from a separate department’s intranet that you don’t want seen here… that’s a job for separate firefox profiles. Or probably KDE Activities, too. Or switching users would be best. Also there’s this:

see reddit r/kde/comments/zfnwv2/remove_recent_files_media_controls_when_using/

And they had it fixed by using the above.

unhelpful dynamic actions - I personally never used dynamic actions, maybe relevant to others as well.

I mean sure it’s no good having them there, in the way, being annoying, maybe even carrying a negative accessibility impact, if you never use them… But what about people who want to remove them only for certain apps, such as the above thread? What if we don’t use the actions but do want the recent files? Etc.

It seems like the problem isn’t clearly defined here, the solution is targeting uneffected components, and also missing effected components. It creates a maintenance burden for a benefit that’s questionable…

I don’t know mate, I see a potential problem here, maybe, but this solution doesn’t seem quite right, on multiple levels. I am biased by my fear caused by the regular breakage of this widget (these widgets) but honestly, anyone looking at this code ought to be.

2 Likes

Hi @pallaswept ,
Thank you for your elaborate answer.
I respect your position on this matter, and I understand, even though it’s a tiny patch.
I fixed it locally for my self (just commenting out the dynamic function), but I wanted to share it in case others may want it too.
Since it’s QML code I dont mind patching it locally on every plasma update.
Thanks again!

1 Like

I mean it would be cooler if you didn’t have to. I’m not trying to put you off of contributing entirely, just trying to shine a light on some possibly non-obvious pitfalls.

Just in case you feel like I’m being overcautious… This is one of those times when it sucks to be right. It’s broken in 6.3 :laughing: Maybe I jinxed it!

1 Like