jabref
jabref copied to clipboard
Menus from the menu bar close immediately after left click is let go of if the menu bar was clicked in its top half
JabRef 5.0-beta.362--2020-01-25--ac90ad2 Linux 5.4.13-3-manjaro amd64 Java 13.0.2
-
[ ] I have tested the latest development version from http://builds.jabref.org/master/ and the problem persists
-
[x] I have built the latest master branch from source (commit ac90ad29b4302e0287f53af456bd1cb37521833a) and also observed this issue in the current beta release.
Steps to reproduce the behavior:
- Click on any item in the menu bar (File, Edit, Library, Quality, Tools, View, Options or Help), above the text line (anywhere in the orange area in the image below, colors were added by me to help explain the problem).
- Try to select anything from the submenu that opens.
Expected behavior:
- The corresponding submenu should stay open after clicking in its title.
Actual behavior:
- If the user clicks the top half of the menu bar (orange area in the image), the submenu that opens closes immediately after the left mouse button is let go of. If you maintain the left mouse button pressed, the menu stays open, but nothing can be selected while the left mouse button stays pressed.
- If the submenu is clicked in its bottom half (blue area in the image), everything works as expected.
Perhaps this is the same but if you left click on a menu and try to scroll down to menu items they are not highlughted and cannot be selected. However, if you repeat the same thing the second time the menu items become selectable.
I don't know if this is related, but when I open a menu from the menu bar, there is a gap between the menu bar and the menu. I don't know if that's the default behavior of the application, or if this is not supposed to happen.
Can confirm that the problem still persisits in Manjaro Linux, i3 wm, seems to be related to i3 wm issue. The problem got solved when I switched to xfce4 wm, where the menus in the menu bar became clickable again.
If it is relevant, I also did my tests on a tiling window manager (bspwm), so it may be a problem on these kinds of WMs...
I am on KDE Plasma 5
Maybe this is related to this issue? #5526
I am not sure, as we are dealing with floating menus here and not dialog windows.
- Currently, JabRef dialog windows behave as regular windows and take up half of the screen when they open, as is common in tiling window managers.
- The floating menus keep their intended size. They just aren't interactive in some cases.
But maybe fixing #5526 also fixes this one, who knows.
I'm also experiencing this under i3wm.
Having the same issue in i3wm.
Having the same issue in i3wm also
same issue with i3wm
I searched around and it seems to be an issue in the javafx version 14: https://bugs.openjdk.java.net/browse/JDK-8251240
Based on the javafx issue cited above, running with environment variable GDK_DISPLAY=1 fixes this issue under XMonad (another tiling window manager).
Based on the javafx issue cited above, running with environment variable GDK_DISPLAY=1 fixes this issue under XMonad (another tiling window manager).
This seemed to work yesterday, but I cannot replicate the workaround today. Not sure what changed, please disregard.
However, here is another workaround that seems to work and might help diagnose the issue. Click and hold on menu (e.g. "file"), drag cursor out of JabRef window (e.g., into neighbouring tiled window, status bar, etc.). Release and menu stays open.
Alt then cursor keys also work for navigating the menus, but this is not a fix.
Still persistent on Regolith Linux (Ubuntu 20.04 with i3wm). As a quick fix, it works for me when I click on the menu item's lower quarter.
I have the same problem on Arch with Qtile. The workaround of @hemker works for me.
The issue is still there on arch i3wm
Work around is good for me too. I am running Arch with KWin though.
Using Manjaro with i3WM and jabref from the AUR, everything up to date, issue still stands.
Working on the lower part of the menu does seem to be a valid workaround.
ditto (Arch + i3wm).
Same issue in swaywm + openSUSE
awesomewm + Xubuntu works
To fix the issue permanently set the following system property: java -Djdk.gtk.version=2
.
This can be done globally by adding _JAVA_OPTIONS="-Djdk.gtk.version=2"
to /etc/environment
, or by setting the environment variable in your shell (e.g. ~/.bashrc
) It can also be set locally by editing JabRef.cfg
in your installation folder (possibly located at /opt/JabRef/lib/app/JabRef.cfg
) and add the line -Djdk.gtk.version=2
in the [JavaOptions]
section.
Setting the java option -Djdk.gtk.version=2 fixed the issue for me on i3wm.
Thank you. Verified this and it works!
@Da-Va @HakonHarnes Thanks for your solution! Can you please add a section as well to the troubleshooting here? https://docs.jabref.org/installation
@Da-Va @HakonHarnes Thanks for your solution! Can you please add a section as well to the troubleshooting here? https://docs.jabref.org/installation
See my PR.
For my case: swaywm + flatpak version of jabref
, -Djdk.gtk.version=2
does not work.
This is a newer issue of javafx: https://bugs.openjdk.org/browse/JDK-8292298
Flatpak issue
It seems like Flatpak is not using GTK 2, even when specified with -Djdk.gtk.version=2
.
Running the Flatpak version of JabRef outputs:
Picked up _JAVA_OPTIONS: -Djdk.gtk.version=2
WARNING: A command line option has enabled the GTK 2 library
WARNING: The JavaFX GTK 2 library is deprecated and will be removed in a future release
Which indicates GTK 2 is indeed being used. However, there is also this message:
Gtk-Message: 19:33:33.990: Failed to load module "canberra-gtk-module"
Which I suspect causes Flatpak to instead use GTK 3, because the following error is specific to GTK 3: (See https://stackoverflow.com/questions/55446534/how-to-fix-java22494-gdk-warning)
Gdk-WARNING **: 19:33:36.010: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.
So it seems when it doesn't find canberra-gtk-module
it reverts back to using GTK 3.
This can be fixed by the developers by either:
- Using the GTK 2 shared module provided by flathub (See https://docs.flatpak.org/en/latest/manifests.html#shared-modules).
- Using a different runtime that already has GTK 2 installed (e.g.
org.gnome.sdk
)
Flatpak workaround
The Flatpak version of JabRef currently uses org.freedesktop.Platform
runtime which doesn't support GTK 2. The workaround involves installing and using the org.gnome.sdk
runtime.
Force GTK 2 for JabRef by setting -Djdk.gtk.version=2
with:
sudo flatpak override --env _JAVA_OPTIONS="-Djdk.gtk.version=2" org.jabref.jabref
Alternatively, the _JAVA_OPTIONS
environment variable can be set in /etc/environment
or in the config file of your shell (e.g. bashrc
).
Download and install the org.gnome.sdk
:
(Note: I only got this to work with version 3.24)
flatpak install runtime/org.gnome.Sdk/x86_64/3.24
Run JabRef with the org.gnome.sdk
runtime:
flatpak run --runtime=org.gnome.Sdk --runtime-version=3.24 org.jabref.jabref
@LyzardKing any thoughts on this? Do we need to modify the flatpak build script?