termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.33k stars 3.07k forks source link

[Bug]: xfce4-appmenu-plugin does not work without appmenu-gtk-module #17896

Closed gborzi22 closed 6 months ago

gborzi22 commented 1 year ago

Problem description

xfce4-appmenu-plugin is a plugin for the xfce panel that should show the focused application menu in the panel instead of the application window, preceded by the application name. It should work for gtk2/gtk3 apps and qt5 apps. Currently it only shows the application name, without any menu. The main problem is that it lacks the appmenu-gtk-module component. This can be easily (and partially) fixed by changing "-Dappmenu-gtk-module=disabled" to "-Dappmenu-gtk-module=enabled" in build.sh, adding gtk2 to TERMUX_SUBPKG_DEPENDS and putting:

TERMUX_SUBPKG_INCLUDE="
share/xfce4/panel/plugins/
lib/
share/glib-2.0/schemas/
"

in subpackage.sh. I recompiled the package with these modifications and now it works as expected for gtk3 apps, i.e. the menu is no longer in the application window but is shown on the plugin area. For gtk2 apps it shows the menu both in the plugin and the app. For qt apps it does not work, the menu is displayed normally. The environment variable GTK_MODULES should be set to "appmenu-gtk-module".

What steps will reproduce the bug?

Install xfce4 and the appmenu-plugin, follow the instructions in vala-panel-project and open a gtk3 app, like vim-gtk. The plugin only shows the application name, no menu.

What is the expected behavior?

Show the menu in the plugin.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=pacman
TERMUX_APP_PID=8187
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=pacman
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# /data/data/com.termux/files/usr/etc/pacman.conf
[main]
Usage = All
Server = https://service.termux-pacman.dev/main/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/main/aarch64
[x11]
Usage = All
Server = https://service.termux-pacman.dev/x11/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/x11/aarch64
[root]
Usage = All
Server = https://service.termux-pacman.dev/root/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/root/aarch64
[tur]
Usage = All
Server = https://service.termux-pacman.dev/tur/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/tur/aarch64
[tur-continuous]
Usage = All
Server = https://service.termux-pacman.dev/tur-continuous/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/tur-continuous/aarch64
[tur-multilib]
Usage = All
Server = https://service.termux-pacman.dev/tur-multilib/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/tur-multilib/aarch64
[gpkg]
Usage = All
Server = https://service.termux-pacman.dev/gpkg/aarch64
Server = https://s3.amazonaws.com/termux-pacman.us/gpkg/aarch64
Updatable packages:
All packages up to date
termux-tools version:
1.39.0
Android version:
11
Kernel build information:
Linux localhost 4.14.193 #1 SMP PREEMPT Thu Jan 6 15:02:33 CST 2022 aarch64 Android
Device manufacturer:
incar
Device model:
SGIN_X10
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.x11 versionCode:14
ShadowEO commented 11 months ago

I need to second this, without the modules xfce4-appmenu-plugin is completely useless. The QT module is needed for QT apps to be able to use it, and the GTK module needs to be there for any other apps.

Would love to use the plug-in without recompiling the package myself to get it. Thanks gborzi22 for the information, I knew I was missing something while attempting to recompiling it last night!

Biswa96 commented 7 months ago

I have built vala-panel-appmenu with -Dappmenu-gtk-module=enabled and gtk3 module but did not get the application menu in panel. Could anyone share how to troubleshoot the issue?

gborzi22 commented 7 months ago

@Biswa96 You need to set the environment variable GTK_MODULES to "appmenu-gtk-module" plus any other gtk module you want to use. I set it in my .bashrc as export GTK_MODULES="canberra-gtk-module:appmenu-gtk-module" then start xfce and add the "Appmenu Plugin" to your panel. Hope this helps. EDIT: actually it works with gtk2 apps.

Biswa96 commented 7 months ago

then start xfce and add the "Appmenu Plugin" to your panel.

Oh, I missed that step. It works now with thunar, terminal etc. The project depends on newer glib2 and its gobject-introspection data. I am waiting for that pull request to be merged.

Biswa96 commented 7 months ago

I have added a pull request to fix this issue. Would you like to test the packages from GitHub Actions artifacts of that pull request? Link https://github.com/termux/termux-packages/actions/runs/8680670258

The following screenshots show the change in panel after adding the plugin.

before

after