Fix double title bars with grouped floating frames #4264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Fixes #2455
Description of the Change
This is a workaround for some strange JIDE behaviour for floating frames that are docked together. The containing dialog was being decorated (via
this.setUndecorated(false)
), and its root pane was being decorated as a dialog (viathis.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG)
), resulting in two separate title bars.The new behaviour is found in the
SingleTitleBarDialogFloatingContainer
class which overrides theupdateUndecorated()
method responsible for setting the decorations on these dialogs. It always sets the dialog itself as undecorated and will set the root pane as decorated when decorations are needed.I could just as well have done the opposite (decorate the dialog itself, not the root pane), but I preferred these aesthetics and also liked that the docked frames would be a distinguished from "normal" dialogs. For reference, this is what it would have looked like (compare with images further below):
Possible Drawbacks
There is some inconsistency with decorations on different systems, so it's possible this particular solution could run afoul of some system's expectations.
Documentation Notes
Prior to MT 1.14.0, docking floating frames together would result in multiple title bars:
Now that no longer happens, so docking just has the one title bar:
Release Notes
This change is