-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decorations support for macOS. #54
Conversation
Signed-off-by: weisj <weisj@arcor.de>
cdb38e2
to
282106e
Compare
Signed-off-by: weisj <weisj@arcor.de>
Signed-off-by: weisj <weisj@arcor.de>
…into macOS_decorations
Signed-off-by: weisj <weisj@arcor.de>
It looks like a reflective approach does not really work :( I tried
I made the following changes: public class MacOSTitlePane extends CustomTitlePane {
private final JRootPane rootPane;
public MacOSTitlePane(JRootPane rootPane) {
this.rootPane = rootPane;
determineColors();
}
@Override
public JRootPane getRootPane() {
return rootPane;
}
Video:
3,4,5 do not happen if |
I feel like we can’t get around actually using an approach with native code. I was aware that the title color would be mismatched but choose to ignore it until the setting the style bits actually works (it’s a lot simpler with native code). I’ll have to look if 4 and 5 also happen for me. Could be a general issue with the custom rootpane implementation. Back to the drawing board then. |
I have c++ and xcode installed. |
Fixed NPE. Signed-off-by: weisj <weisj@arcor.de>
Signed-off-by: weisj <weisj@arcor.de>
Could you please change CustomTitlePane titlePane = Decorations.createTitlePane(root);
setTitlePane(root, titlePane);
updateWindow(root.getParent());
installLayout(root);
if (window != null) {
if (window instanceof Frame && !window.isDisplayable()) {
System.out.println("Frame [" + root + "]"
+ " DecorationStyle: " + root.getWindowDecorationStyle()
+ " Undecorated: " + (root.getWindowDecorationStyle() == JRootPane.NONE));
((Frame) window).setUndecorated(root.getWindowDecorationStyle() == JRootPane.NONE);
} else if (window instanceof Dialog && !window.isDisplayable()) {
System.out.println("Dialog [" + root + "]"
+ " DecorationStyle: " + root.getWindowDecorationStyle()
+ " Undecorated: " + (root.getWindowDecorationStyle() == JRootPane.NONE));
((Dialog) window).setUndecorated(root.getWindowDecorationStyle() == JRootPane.NONE);
}
root.revalidate();
root.repaint();
} and tell me the output when opening the dialog that doesn't have any titlebar. |
"pick one of several options", Java 11:
Java 13 (I guess the output is the same):
|
Does disabling |
Just in case, } else if (SystemInfo.isMac) {
decorationsProvider = new MacOSDecorationsProvider();
} else { "non-modal dialog"
|
Is it always the same dialog that has no title bar? If yes please check whether only the following are affected:
If yes again please verify that |
Signed-off-by: weisj <weisj@arcor.de>
Signed-off-by: weisj <weisj@arcor.de>
@vlsi Could you check if the latest additions fix the missing titlebar for you? Also do dialogs still get smaller when reopening? |
Signed-off-by: weisj <weisj@arcor.de>
4977514
to
a942dea
Compare
I have now removed the useage of As for disabling native code I have:
|
Disable decorations if necessary modules aren't included. Signed-off-by: weisj <weisj@arcor.de>
@vlsi Could you try out the new version? |
Co-Authored-By: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Co-Authored-By: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@@ -57,6 +61,8 @@ fun Provider<String>.overrideToString() = object { | |||
override fun toString() = orNull ?: "" | |||
} | |||
|
|||
val TargetMachine.getVariantName: String get() = "$operatingSystemFamily-$architecture" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val TargetMachine.getVariantName: String get() = "$operatingSystemFamily-$architecture" | |
val TargetMachine.variantName: String get() = "$operatingSystemFamily-$architecture" |
Co-Authored-By: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Co-Authored-By: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Signed-off-by: weisj <weisj@arcor.de>
Signed-off-by: weisj <weisj@arcor.de>
Can you check if this still happens? If yes does |
Ok, now it works great 🎉 |
Any last thoughts? Something that needs to change? Otherwise I'll merge the PR. |
I think this is ready to merge. |
No description provided.