JDK-8263169 : [macOS] JavaFX windows open as tabs when system preference for documents is set
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: openjfx15
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2021-03-07
  • Updated: 2021-07-06
  • Resolved: 2021-04-06
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.
JDK 8 Other
8u301Fixed openjfx11.0.12Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
If the MacOS system setting for opening documents as tabs is selected, then all JavaFX windows including Dialogs are openned as tabs

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. MacOS System Preferences -> General -> Open All Documents as Tabs
2. Create a Hello World JavaFX application with a Stage and a button. Clicking that button opens a Dialog. 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Dialog opens as window
ACTUAL -
it opens as tab

FREQUENCY : always



Comments
Mail to submitter: ============= The issue has been resolved in Java FX 17 [1]. Please share your feedback checking in early-access builds. [1] https://gluonhq.com/products/javafx/
11-05-2021

Changeset: 58988582 Author: Kevin Rushforth <kcr@openjdk.org> Date: 2021-04-06 12:10:15 +0000 URL: https://git.openjdk.java.net/jfx/commit/58988582
06-04-2021

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 (which is visually jarring), and will not be sized correctly. Even for ordinary stages, it doesn't seem like the desired behavior. Setting the JavaFX application to disallow opening in tabs is probably the best solution.
18-03-2021

WORKAROUND: Applications can set the owner of the dialog prior to the first time they show it as follows: dialog.initOwner(stage);
18-03-2021

I can confirm that this happens with new top level windows, meaning a Stage or other Window without an owner. Popups, such as those used by Tooltip, ComboBox, etc., still show up as separate windows. Dialogs with the owner set to the stage that created them also are shown as separate windows.
18-03-2021

more discussion here: https://stackoverflow.com/questions/52713897/javafx-alert-doesnt-open-in-new-window-but-in-a-new-tab https://github.com/openjfx/openjfx-docs/issues/168
08-03-2021

Checked with attached testcase in macOS Mojave version 10.14.6, upon changing the system settings, In Dock of System Preferences, setting to Prefer tabs when opening documents to Always Test Result: ========= openjfx11:Fail openjfx15:Fail openjfx16:Fail attached screenshot for reference
08-03-2021