From 948decb3b58b084862a98f729e98408f96734521 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 2 Aug 2024 23:47:29 +0200 Subject: [PATCH] Popup: fixed `UnsupportedOperationException: PERPIXEL_TRANSLUCENT translucency is not supported` exception on Haiku OS when showing popup (partly) outside of window (issue #869) --- CHANGELOG.md | 9 +++++++++ .../java/com/formdev/flatlaf/ui/FlatPopupFactory.java | 5 ++++- gradle.properties | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1195bc30..a9ecc6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ FlatLaf Change Log ================== +## 3.5.1-SNAPSHOT + +#### Fixed bugs + +- Popup: Fixed `UnsupportedOperationException: PERPIXEL_TRANSLUCENT translucency + is not supported` exception on Haiku OS when showing popup (partly) outside of + window. (issue #869) + + ## 3.5 #### New features and improvements diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java index 2a4bf6a5..6ff0b1f5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java @@ -139,7 +139,10 @@ public class FlatPopupFactory forceHeavyWeight = true; // create drop shadow popup - return new DropShadowPopup( getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ), owner, contents ); + Popup popupForScreenOfOwner = getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ); + return owner.getGraphicsConfiguration().isTranslucencyCapable() + ? new DropShadowPopup( popupForScreenOfOwner, owner, contents ) + : new NonFlashingPopup( popupForScreenOfOwner, owner, contents ); } /** diff --git a/gradle.properties b/gradle.properties index 873a8dff..9350fc84 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ # flatlaf.releaseVersion = 3.5 -flatlaf.developmentVersion = 3.6-SNAPSHOT +flatlaf.developmentVersion = 3.5.1-SNAPSHOT org.gradle.parallel = true # org.gradle.warning.mode = all