Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: The quest to GTK+ App Menus on KDE Plasma (Read 2165 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

The quest to GTK+ App Menus on KDE Plasma

I want to share something with you... call it a journey in fixing stuff, or call it a desperate attempt to achieve consistency, but before you get your hopes too high I must say that I still didn't figure it out.

I am still setting up my fairly new Artix/KDE installation, made from the base ISO, with OpenRC. I began customizing it with themes to make it more "personal" and a thing that really helps me reduce the space occupied by bars is the "global appmenu" widget that I use to put on the plasma panel on the top of the screen, so I can minimize the waste of desktop space.

It turns out that by default it will only work in QT5 applications. Then I remembered about appmenu-gtk-module being a thing and I installed it, with all the dependencies sorted out and the environment variables in the right places; however I couldn't make those menus work on the global widget. Then, I tried compiling the global appmenu addon from scratch but still nothing. Then I began testing both GTK2 and GTK3 apps to see if I had any chance to get more info about why it won't work and.. nothing.

Then I turned to dbus-monitor to see if something was going on and nothing is actually going on, it's almost like I did nothing at all; but the "env" command shows "appmenu-gtk-module" on the GTK_MODULES environment variable and UBUNTU_MENUPROXY is set to 1 (thanks Canonical, really cool) and all of this is as described from the startup of X11 so... why? what am I missing at this point? Could it be that GTK apps cannot connect to dbus? (I kinda doubt so, though)

I am, to the best of my efforts, kind of lost right now.

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #1
I want to share something with you... call it a journey in fixing stuff, or call it a desperate attempt to achieve consistency, but before you get your hopes too high I must say that I still didn't figure it out.

I am still setting up my fairly new Artix/KDE installation, made from the base ISO, with OpenRC. I began customizing it with themes to make it more "personal" and a thing that really helps me reduce the space occupied by bars is the "global appmenu" widget that I use to put on the plasma panel on the top of the screen, so I can minimize the waste of desktop space.

It turns out that by default it will only work in QT5 applications. Then I remembered about appmenu-gtk-module being a thing and I installed it, with all the dependencies sorted out and the environment variables in the right places; however I couldn't make those menus work on the global widget. Then, I tried compiling the global appmenu addon from scratch but still nothing. Then I began testing both GTK2 and GTK3 apps to see if I had any chance to get more info about why it won't work and.. nothing.

Then I turned to dbus-monitor to see if something was going on and nothing is actually going on, it's almost like I did nothing at all; but the "env" command shows "appmenu-gtk-module" on the GTK_MODULES environment variable and UBUNTU_MENUPROXY is set to 1 (thanks Canonical, really cool) and all of this is as described from the startup of X11 so... why? what am I missing at this point? Could it be that GTK apps cannot connect to dbus? (I kinda doubt so, though)

I am, to the best of my efforts, kind of lost right now.


On STOCK Artix Plasma we have dot folders and dot files  from MATE OPENBOX GNOME3 XFCE and all other GTK software.. Name a GTK software you  know and there it is polluting pure Qt Artix Plasma. Why? Were all desktop environments installed with all its software then removed GTK but all in Home folder is left? Looks like this is the case. All DE (GOME, XFCE, Openbox, MATE and KDE) were installed on one system, then GNOME, XFCE, Openbox, MATE were removed. KDE was left and Artix iso was called Plasma version. Except in Home folder every single GTK app dot folder and every single GTK app dot file remained. Polluttion!


Re: The quest to GTK+ App Menus on KDE Plasma

Reply #3
On STOCK Artix Plasma we have dot folders and dot files  from MATE OPENBOX GNOME3 XFCE and all other GTK software.. Name a GTK software you  know and there it is polluting pure Qt Artix Plasma. Why? Were all desktop environments installed with all its software then removed GTK but all in Home folder is left? Looks like this is the case. All DE (GOME, XFCE, Openbox, MATE and KDE) were installed on one system, then GNOME, XFCE, Openbox, MATE were removed. KDE was left and Artix iso was called Plasma version. Except in Home folder every single GTK app dot folder and every single GTK app dot file remained. Polluttion!
It's part of the uniform theming, it's intentional and you are off-topic. Open up a new one.
If you want pure, use base.

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #4
On STOCK Artix Plasma we have dot folders and dot files  from MATE OPENBOX GNOME3 XFCE and all other GTK software.. Name a GTK software you  know and there it is polluting pure Qt Artix Plasma. Why? Were all desktop environments installed with all its software then removed GTK but all in Home folder is left? Looks like this is the case. All DE (GOME, XFCE, Openbox, MATE and KDE) were installed on one system, then GNOME, XFCE, Openbox, MATE were removed. KDE was left and Artix iso was called Plasma version. Except in Home folder every single GTK app dot folder and every single GTK app dot file remained. Polluttion!

I never said I installed the Plasma ISO. Actually I stated clearly that I installed Plasma on top of the base ISO.

Does it work if you start it with dbus-launch?

I tried it and it didn't work.

To be clear, I have installed:
appmenu-gtk-module
libdbusmenu-glib
libdbusmenu-gtk2
libdbusmenu-gtk3
libdbusmenu-qt5 (this one was actually installed by the plasma metapackage)
lib32-libdbusmenu-glib
lib32-libdbusmenu-gtk2
lib32-libdbusmenu-gtk3

For now, only QT5 applications behave as expected; Electron, GTK+ 2 and GTK+ 3 applications do not behave correctly as they not only don't show the global appmenu but the indicator menus as well are not "integrated" with Plasma Shell and show as GTK+ tooltips (which means that Plasma cannot connect to their DBusMenu instance and calls the GTK+ menu to show instead).
I think this has some (but not all) relation to the libappindicator-gtk2/3 + dbus bug on this other topic.

There are traces of a systemd service on appmenu-gtk-module, however that service only consists of some variable exporting so I confidently exported that one in my .profile and called it a day as I doubt that's the main issue (as appmenu-gtk-module is reported to work in Void Linux + Plasma).

 

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #5
For now, only QT5 applications behave as expected; Electron, GTK+ 2 and GTK+ 3 applications do not behave correctly as they not only don't show the global appmenu but the indicator menus as well are not "integrated" with Plasma Shell and show as GTK+ tooltips (which means that Plasma cannot connect to their DBusMenu instance and calls the GTK+ menu to show instead).
I think this has some (but not all) relation to the libappindicator-gtk2/3 + dbus bug on this other topic.
Could you test-run the latest weekly Plasma ISO and install the global appmenu widget in the live sesion to see if it works? That would narrow things down, if successful.

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #6
The problem is now fixed; I fixed it by putting the following into ~/.xprofile.
Code: [Select]
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
        export $(dbus-launch)
fi
I guess we're clear now about the fact that the problem lies in dbus not exporting the DBUS_SESSION_BUS_ADDRESS variable.

Could you test-run the latest weekly Plasma ISO and install the global appmenu widget in the live sesion to see if it works? That would narrow things down, if successful.
Okay, I will do it shortly.

EDIT: I did it, and it worked flawlessly. No issues with global menu in the latest live ISO.

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #7
Great and thanks for testing the ISO. Please, mark this as solved as it seems fixed in our packaged presets and settings too.

Re: The quest to GTK+ App Menus on KDE Plasma

Reply #8
Great and thanks for testing the ISO. Please, mark this as solved as it seems fixed in our packaged presets and settings too.
 Well, thing is, how should someone fix it the "proper" way when installing from the base ISO then? I get that my "fix" is a little bit too hacky, but I didn't find any clue on the live ISO about exporting that dbus variable properly. It is solved for community installs, yes, but it isn't for who starts from the base ISO.