Skip to content

Native file chooser does not work on some screens, depending on screen layout #1085

@robert-dbvis

Description

@robert-dbvis

Hi! Trying to use the new native file chooser on linux (ubuntu 25.10) with openjdk 21.0.9, default gnome environment on wayland, and experience some problems with the file chooser depending on what screen I start the program from (even if that may sound strange).

I am using a laptop and also an external large monitor. I use both screens. My normal screen layout is that the external is placed over the laptop screen.

So on the desk it looks like:

[ large monitor ]
[ laptop ]

I have a small test casethat only sets up flatlaf and has a program with a button to open the native file chooser.

App.java

If I start this ("mvn compile exec:java") and have the application on the laptop screen then everthing works fine.
If I start this on the large external monitor the file chooser shows up, but it does not repaint correctly so it is hard to interact with. It does seem to respect double-clicks and cancel-button though.

If I change the screen layout using the display settings so that the laptop is on the same level as the large monitor:
[laptop] [large monitor]
(which one is to the left/right does not seem to matter)
Then the application seems to work on both screens.

If I put the large monitor below the laptop screen we are back to the native file chooser only working well on the laptop screen.

I am not sure if this problem is a problem in flatlaf, in gnome or ubuntu or some other part, but other gtk-filechoosers work well on both screens (for example gnome text editor or libreoffice).

I also did a quick test with the javafx native file chooser and it seems to behave in much the same way, so my guess is that this is something that is more in the java/jni layer rather than gtk or OS.

I have not yet tested how this behaves on mac or windows.

Any idea on what the problem may be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions