You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "demitriusbelai (via GitHub)" <gi...@apache.org> on 2023/09/13 14:41:26 UTC

[GitHub] [netbeans] demitriusbelai commented on a diff in pull request #6391: FlatLaf: Enable Window decoration option for Linux

demitriusbelai commented on code in PR #6391:
URL: https://github.com/apache/netbeans/pull/6391#discussion_r1324624261


##########
platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanelController.java:
##########
@@ -75,9 +81,33 @@ public void applyChanges() {
 
             FlatLFCustoms.updateUnifiedBackground();
 
-            if (oldUseWindowDecorations != FlatLafPrefs.isUseWindowDecorations()) {
-                FlatLaf.setUseNativeWindowDecorations(FlatLafPrefs.isUseWindowDecorations());
-            } 
+            boolean isUseWindowDecorations = FlatLafPrefs.isUseWindowDecorations();
+            if (oldUseWindowDecorations != isUseWindowDecorations) {
+                if (FlatLaf.supportsNativeWindowDecorations()) {
+                    FlatLaf.setUseNativeWindowDecorations(isUseWindowDecorations);
+                } else {
+                    JFrame.setDefaultLookAndFeelDecorated(isUseWindowDecorations);

Review Comment:
   > This complicated code runs only if the setting is changed from the Options dialog while NetBeans is running, right?
   
   Yes.
   
   > So if there are bugs, they will go away when NetBeans is restarted?
   
   Yes.
   
   I know that it looks like a ugly hack. If you want this removed I do not mind. We can restart NetBeans to activate/deactivate the window decoration anyway.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists