Bug 400034 - Consider embedding the official plasma global menu instead of using current AWC global menu implementation
Summary: Consider embedding the official plasma global menu instead of using current A...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Active Window Control
Classification: Unmaintained
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Chris Holland
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-19 18:01 UTC by avlas
Modified: 2025-06-13 00:05 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description avlas 2018-10-19 18:01:12 UTC
AWC functionality is great but I modestly think that its implementation of the global menu is currently not as good as plasma's official global menu. Hence I suggest embedding the official global menu instead.

This is doable. I have a piece of code that integrates the active application applet (https://github.com/kupiqu/plasma-active-application derived from AWC) together with the official global menu. 

I could upload this integrated applet to github if interested (this implementation does not include AWC buttons, but I don't think it would be very hard to add them). 

But please note that my skills as Plasma dev are limited, so this is not to say that my code should be used or is any better. This is just to reccomend using the official global menu and deviating from it the least that is possible. 

Ideally all AWC functionality would be part of the official plasma workspace, but until this is a reality...
Comment 1 Chris Holland 2018-10-19 18:39:02 UTC
Last I looked into using the GlobalMenu (aka appmenu) widget's code, it wouldn't work since you'd need the plugin namespace to be org.kde.appmenu. You need the appmenu's nativeInterface to even trigger a button.

* https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/metadata.desktop#L84
* https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/contents/ui/main.qml#L39
* https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/contents/ui/main.qml#L133

This is why AWC was forced to copy the appmenu code.

As for "embedding" the widget... Hmmm. It's possible to do (like the System Tray or the Group widget), but I've never done that before.

AWC could break into 2 widgets, the "app title + window buttons" could be 1 widget, and the global menu a different widget.

Global menu would need to be patched to offer the following though:
* Ability to fill up the panel width
* Double click to toggle maximize and all the other mouse shortcuts.

An issue with making it multiple widgets is that you'd get padding between the widgets you'd have no way of controlling. So you wouldn't be able to get this exact look: https://i.imgur.com/p6UMZE2.png
Comment 2 avlas 2018-10-19 19:04:52 UTC
(In reply to Chris Holland from comment #1)
> Last I looked into using the GlobalMenu (aka appmenu) widget's code, it
> wouldn't work since you'd need the plugin namespace to be org.kde.appmenu.
> You need the appmenu's nativeInterface to even trigger a button.
> 
> *
> https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/
> metadata.desktop#L84
> *
> https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/
> contents/ui/main.qml#L39
> *
> https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/
> contents/ui/main.qml#L133
> 
> This is why AWC was forced to copy the appmenu code.
> 
> As for "embedding" the widget... Hmmm. It's possible to do (like the System
> Tray or the Group widget), but I've never done that before.
> 
> AWC could break into 2 widgets, the "app title + window buttons" could be 1
> widget, and the global menu a different widget.
> 
> Global menu would need to be patched to offer the following though:
> * Ability to fill up the panel width
> * Double click to toggle maximize and all the other mouse shortcuts.
> 
> An issue with making it multiple widgets is that you'd get padding between
> the widgets you'd have no way of controlling. So you wouldn't be able to get
> this exact look: https://i.imgur.com/p6UMZE2.png

I don't consider myself more than a newbie for plasma development and perhaps the way I combined the two functionalities is totally wrong, but why don't I upload this piece of code to github and you take a fast look? [I will try to find the time to do so asap and will link to it here.]

You could have this "Double click to toggle maximize and all the other mouse shortcuts" just on the application name, or do you need this working also in global menu buttons?
Comment 3 Chris Holland 2018-10-29 03:08:02 UTC
I recently forked the "kdeplasma-addons/applets/grouping" widget to see how difficult it would be to create a "container" Plasma::Applet which embeds a private Plasma::Container "applet". The Plasma::Container applet can load a nested widget like the Global Menu.

I've uploaded the code I'm toying around with here:
https://github.com/Zren/plasma-awc2

I still need to make the private applet resize itself to the same size as it's nested appmenu widget, but I've managed to remove the TabBar+StackWidget and make it automatically add a global menu.

I'll be deleting the repo once I'm comfortable refactoring AWC to use a Plasma::Container.
Comment 4 trmdi 2018-10-29 04:13:54 UTC
Nice. That would save a lot of energy from maintaining different projects with the same feature.
In the future, it could be like this:
    AWC = [ buttons (from psifidotos) + official global menu. ]

I hope they could work together smoothly.
Comment 5 trmdi 2018-10-29 04:18:20 UTC
(In reply to trmdi from comment #4)
> Nice. That would save a lot of energy from maintaining different projects
> with the same feature.
> In the future, it could be like this:
>     AWC = [ buttons (from psifidotos) + official global menu. ]
> 
> I hope they could work together smoothly.

But would we still need AWC while we could place [ buttons (from psifidotos) + official global menu. ] directly on the panel ?

I think Zren and psifidotos should discuss before implementing things, to save your enegery.
Comment 6 trmdi 2020-01-13 03:33:03 UTC
Oh, nowadays you could use the applets by psifidotos. They are so good. AWC is almost dead.:)
Comment 7 TraceyC 2025-06-13 00:05:54 UTC
Active Window Control was archived, and saw its last update 2 years ago. All bugs for it are being closed.

Thanks for your understanding.