jabref icon indicating copy to clipboard operation
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

Open douglasrizzo opened this issue 5 years ago • 22 comments

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:

  1. 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).
  2. Try to select anything from the submenu that opens.

Untitled

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.

douglasrizzo avatar Jan 25 '20 15:01 douglasrizzo

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.

sambo57u avatar Jan 26 '20 14:01 sambo57u

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.

Untitled

douglasrizzo avatar Jan 27 '20 11:01 douglasrizzo

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.

nujabse avatar Feb 29 '20 12:02 nujabse

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...

douglasrizzo avatar Mar 03 '20 12:03 douglasrizzo

I am on KDE Plasma 5

sambo57u avatar Mar 03 '20 13:03 sambo57u

Maybe this is related to this issue? #5526

Siedlerchr avatar Mar 03 '20 18:03 Siedlerchr

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.

douglasrizzo avatar Mar 03 '20 22:03 douglasrizzo

I'm also experiencing this under i3wm.

Etherealflux avatar May 07 '20 14:05 Etherealflux

Having the same issue in i3wm.

krummja avatar Aug 24 '20 04:08 krummja

Having the same issue in i3wm also

gonced8 avatar Aug 31 '20 08:08 gonced8

same issue with i3wm

Jayanth-kumar5566 avatar Sep 02 '20 07:09 Jayanth-kumar5566

I searched around and it seems to be an issue in the javafx version 14: https://bugs.openjdk.java.net/browse/JDK-8251240

Siedlerchr avatar Sep 02 '20 22:09 Siedlerchr

Based on the javafx issue cited above, running with environment variable GDK_DISPLAY=1 fixes this issue under XMonad (another tiling window manager).

MaciekChudek avatar Oct 06 '20 19:10 MaciekChudek

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.

MaciekChudek avatar Oct 08 '20 19:10 MaciekChudek

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.

hemker avatar Feb 04 '21 13:02 hemker

I have the same problem on Arch with Qtile. The workaround of @hemker works for me.

ploedige avatar May 25 '21 15:05 ploedige

The issue is still there on arch i3wm

action-server avatar Jun 25 '21 00:06 action-server

Work around is good for me too. I am running Arch with KWin though.

bear-jordan avatar Jul 08 '21 03:07 bear-jordan

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.

jpmvferreira avatar Jan 05 '22 21:01 jpmvferreira

ditto (Arch + i3wm).

00riddle00 avatar Mar 03 '22 18:03 00riddle00

Same issue in swaywm + openSUSE

Adriankhl avatar May 04 '22 02:05 Adriankhl

awesomewm + Xubuntu works

Da-Va avatar Sep 21 '22 14:09 Da-Va

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.

HakonHarnes avatar Oct 19 '22 20:10 HakonHarnes

Setting the java option -Djdk.gtk.version=2 fixed the issue for me on i3wm.

Thank you. Verified this and it works!

Da-Va avatar Oct 24 '22 09:10 Da-Va

@Da-Va @HakonHarnes Thanks for your solution! Can you please add a section as well to the troubleshooting here? https://docs.jabref.org/installation

Siedlerchr avatar Oct 24 '22 14:10 Siedlerchr

@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.

HakonHarnes avatar Oct 25 '22 06:10 HakonHarnes

For my case: swaywm + flatpak version of jabref, -Djdk.gtk.version=2 does not work.

Adriankhl avatar Oct 25 '22 14:10 Adriankhl

This is a newer issue of javafx: https://bugs.openjdk.org/browse/JDK-8292298

Adriankhl avatar Oct 25 '22 15:10 Adriankhl

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:

  1. Using the GTK 2 shared module provided by flathub (See https://docs.flatpak.org/en/latest/manifests.html#shared-modules).
  2. 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 

HakonHarnes avatar Oct 25 '22 18:10 HakonHarnes

@LyzardKing any thoughts on this? Do we need to modify the flatpak build script?

Siedlerchr avatar Oct 25 '22 19:10 Siedlerchr