-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Undecorated frame/dialog with default border (Windows 11 only) #978
Comments
Don't understand what you want 😕 |
Sorry. For now - it's impossible to set native Windows 11 border to undecorated dialog/frame. I thought - it's limitation of undecorated windows, but - looks like its not. IntelliJ IDEA set native Windows 11 border to undecorated frame (sample screenshot and code which is set to it). I tested with current version of FlatLaf (and removed if-undecorated-return statement) - but native library return hwnd=0, for now I'm don't known why it return 0. Will be nice to have option for setting native border to undecorated frames/dialogs at least at Windows 11 (its limitation of IDEA too) Thanks |
Then the win32 window is not yet created. You could also hide the min/max/close buttons and use full window content mode for a decorated frame. |
And, you are right. But my fast check show dialog without border anyway. But (always forgetting native window flow) I known about IDEA & Consulo used undecorated windows for popups like this for all. Will be nice to save this setting. I will test today maybe - how it works at macOS (about border shadow), as I known IDEA emulate shadow border at |
Test at mac. macOS always render shadow for undecorated frame, but without rounded borders. If I call method FlatPopupFactory#setupRoundedBorder we have perfect undecorated window at mac public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
FlatMacLightLaf.setup();
JFrame frame = new JFrame() {
@Override
public void addNotify() {
super.addNotify();
try {
Method method = FlatPopupFactory.class.getDeclaredMethod("setupRoundedBorder", Window.class, Component.class, Component.class);
method.setAccessible(true);
method.invoke(null, this, this, getRootPane());
} catch (Exception e) {
e.printStackTrace();
}
}
};
frame.setLocationRelativeTo(null);
frame.setSize(500, 500);
frame.setUndecorated(true);
frame.setLocation(300, 300);
frame.setVisible(true);
});
}
} Also calling this method at Windows make good border (but without shadow) Maybe introduce new parameter for |
Hello. IntelliJ IDEA use same hack as for default frame. Here example:
Code from intellij
https://github.com/JetBrains/intellij-community/blob/master/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java#L253
The text was updated successfully, but these errors were encountered: