RFR: 8263169: [macos] JavaFX windows open as tabs when system preference for documents is set

Kevin Rushforth kcr at openjdk.java.net
Wed Mar 24 13:43:57 UTC 2021


If the macOS system settings for opening documents as tabs is set to "Always", then all JavaFX windows, including Dialogs, are opened as tabs, unless they are child windows (that is, a Window with an owner).

This is a real problem for certain types of dialogs, such as `APPLICATION_MODAL` dialogs, regardless of whether the app uses `show()` or uses `showAndWait()` to spin up a nested event loop. Also, if the dialog is of a different size that the main window, it will resize itself when switching tabs (which is visually jarring), and will not be sized correctly. Even for ordinary stages, this isn't the desired behavior.

The fix is to disallow opening in tabs for all JavaFX windows. There are a couple existing tests that fail when the setting for opening documents in tabs is set to "Always", but I also added a new explicit test for this by creating two Stages and verifying that both are active at the same time.

-------------

Commit messages:
 - 8263169: [macos] With changed system preference JavaFX window will open as tabs

Changes: https://git.openjdk.java.net/jfx/pull/440/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=440&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263169
  Stats: 174 lines in 2 files changed: 174 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/440.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/440/head:pull/440

PR: https://git.openjdk.java.net/jfx/pull/440


More information about the openjfx-dev mailing list