JDK-8251240 : Menus inaccessible on Linux with i3 wm
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2020-07-28
  • Updated: 2023-12-17
  • Resolved: 2023-09-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx17.0.10Fixed
Related Reports
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 20.04, i3wm

A DESCRIPTION OF THE PROBLEM :
When using i3 on Linux, it's not possible to interact with menus in the menu bar. They vanish immediately after being activated, and they appear in the wrong location relative to the menu bar

This used to work in JavaFX 8u261, but it doesn't in JavaFX 14.0.2

REGRESSION : Last worked in version 8u261

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached program when using the i3 window manager, and try to interact with the menus

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The menus should be useable

---------- BEGIN SOURCE ----------
public class BasicJavaFx
{
    public static void main(String[] args)
    {
        Application.launch(MainWindow.class);
    }
    
    public static class MainWindow extends Application
    {
        @Override
        public void start(Stage primaryStage)
        {
            final Menu file = new Menu("File");
            file.getItems().addAll(
                    new MenuItem("Open"),
                    new MenuItem("Save"),
                    new SeparatorMenuItem(),
                    new MenuItem("Exit")
            );

            final Menu edit = new Menu("Edit");
            edit.getItems().addAll(
                    new MenuItem("Copy"),
                    new MenuItem("Paste")
            );

            final MenuBar menuBar = new MenuBar(file, edit);

            final VBox root = new VBox(menuBar);

            final Scene scene = new Scene(root, 600, 400);
            primaryStage.setScene(scene);
            primaryStage.show();
        }
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jfx17u/pull/173 Date: 2023-12-17 12:40:49 +0000
17-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx21u/pull/34 Date: 2023-11-23 14:42:17 +0000
23-11-2023

Changeset: f1859743 Author: Thiago Milczarek Sayao <tsayao@openjdk.org> Date: 2023-09-15 12:56:42 +0000 URL: https://git.openjdk.org/jfx/commit/f18597430d44f70086364170f7bb1e5d30e7ce56
15-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1173 Date: 2023-07-09 17:43:05 +0000
09-07-2023

I've been testing recently latest 21ea on i3, after JDK.8269528 was merged, and this issue is still happening. Going through the commits in https://github.com/openjdk/jfx/pull/915, up until the fix for JDK-8089923, the menu works fine on i3, but after https://github.com/openjdk/jfx/commit/1a16badbeb2726f7656b8da51fe8f2c9b3bb006e the menu fails again. [~tsayao] Is this something you can look at?
07-07-2023

Once JDK-8260528 is integrated (which is the bug fixed by PR #915), this bug can be closed as a duplicate.
29-11-2022

This is fixed by https://github.com/openjdk/jfx/pull/915
29-11-2022

One possible explanation is that JavaFX is detecting Hi-DPI scaling in OpenJFX 14. If so, a possible workaround would be to set GDK_DISPLAY=1 in the environment. Another possibility is a bug in the GTK3 window toolkit (Glass) code. If so, another possible workaround would be to run with the following system property set: $ java -Djdk.gtk.version=2
11-08-2020

Additional Information from Submitter: =========================== I've seen some comments on the bug tracker I'm not using JAvaFX 14 on Java 8. 1. In one test, I have Oracle Java 8 with the bundled JavaFX 8 that come with that 2. In a separate test, I have OpenJDK 14 with OpenJFX 14 Both tests are run on the same OS with i3wm In Oracle Java 8, the menus work as expected in i3wm, all good In the OpenJFX version, the menus do not work with i3wm, which is a regression
11-08-2020

There is no way JavaFX 14 libraries will even load with JDK 8, so that is not a possible explanation. More likely, this is a specific issue with Ubuntu 20.04 and the Window Manager (i3) in question.
07-08-2020

Could not reproduce the issue in 18.04.1-Ubuntu, JDK 14.0.2 + JavaFX 14.0.2.1 appears like a configuration error from the submitter, looks like submitter is trying to use JDK 8 with the JavaFX 14 libraries, writing back to submitter to check with correct configuration(JDK 14.0.2 + JavaFX 14.0.2.1).
07-08-2020