From 1fec7ba553a3aca38c03015b121cb718a272896b Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 26 Feb 2022 23:07:16 +0100 Subject: [PATCH] Linux: support using custom window decorations (issue #482) --- CHANGELOG.md | 10 ++++++++++ .../src/main/java/com/formdev/flatlaf/FlatLaf.java | 11 ++++++----- .../java/com/formdev/flatlaf/ui/FlatMenuBarUI.java | 4 ++-- .../main/java/com/formdev/flatlaf/demo/DemoFrame.java | 7 +++++-- .../java/com/formdev/flatlaf/demo/FlatLafDemo.java | 9 +++++++++ 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a0c3c5..50c674c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ FlatLaf Change Log ================== +## 2.1-SNAPSHOT + +#### New features and improvements + +- Linux: Support using custom window decorations. Enable with + `JFrame.setDefaultLookAndFeelDecorated(true)` and + `JDialog.setDefaultLookAndFeelDecorated(true)` before creating a window. + (issue #482) + + ## 2.0.2 - Native window decorations (Windows 10/11 only): Fixed rendering artifacts on diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 2c00070f..f12a6a41 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -166,11 +166,12 @@ public abstract class FlatLaf * Returns whether FlatLaf supports custom window decorations. * This depends on the operating system and on the used Java runtime. *

- * This method returns {@code true} on Windows 10 (see exception below), {@code false} otherwise. + * This method returns {@code true} on Windows 10/11 (see exception below) + * and on Linux, {@code false} otherwise. *

- * Returns also {@code false} on Windows 10 if: + * Returns also {@code false} on Windows 10/11 if: *