[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449
Open
DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Open
[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Conversation
3a663ea to
e113bc8
Compare
daaria-s
reviewed
Mar 31, 2026
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Popup.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Popup.kt
Outdated
Show resolved
Hide resolved
e113bc8 to
0b671c9
Compare
daaria-s
approved these changes
Apr 1, 2026
Collaborator
daaria-s
left a comment
There was a problem hiding this comment.
Thank you for the updates! LGTM
add missing jbpopuprenderer to commits
0b671c9 to
93a1e86
Compare
AlexVanGogen
reviewed
Apr 2, 2026
Comment on lines
276
to
280
Contributor
There was a problem hiding this comment.
It's not entirely true: blendingEnabled can be true even without compose.interop.blending. Having a transparent Panel.background is enough.
(And I'm not sure that dialog panels cannot have a custom background, different from Panel.background, but it's out of scope for this PR anyway)
Contributor
There was a problem hiding this comment.
WDYT about mentioning compose.interop.blending and transparent panel here? They also affect whether windowShape gets invoked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
During the development of the Got It component, we ran into a limitation of our current
JDialogRenderer. Currently, it can only render windows with rounded corners. While this works perfectly for menus and other types of popups, it fails to provide the best UX for the Got It component since it has a custom shape.So, this PR paves the way so that our Got It component can be rendered in all its glory!
Changes
Popupthat takewindowShape: ((IntSize) -> java.awt.Shape)? = null,. Deprecated variations without it.windowShape: ((IntSize) -> java.awt.Shape)? = null,lambda parameter toPopupRendererand passed it down to bothJDialogRendererandJBPopupRendererJDialogRenderercode to apply the custom window shape defined by the factory lambda if:compose.interop.blendingis disabledwindowShapeis not nullDemo
Screen.Recording.2026-03-05.at.16.08.49.mov
Closeup of Jagged Arrow Shape
Note
Keep in mind this only ever happens if users provide a custom shape via the new factory parameter AND don't enable
compose.interop.blending!Curiously, this minor artifact is not present when the arrow is to the right. No idea why, though.
Release notes
New features
Popupis available which take awindowShapefactory. With this, you can create a custom shape that'll be applied to the window which holds the popup. Bear in mind that this factory is only useful in the following scenario:jewel.customPopupRenderflag enabledcompose.interop.blendingenabledWindowTranslucencycan't render concave corners properly since it forces pixels to be either completely off or on. This means that depending on your custom shape, you can have jagged edges. For this reason, it's highly encouraged to also enablecompose.interop.blendingin your system properties.Deprecated API
Popupcomponents without thewindowShapeparameter are now deprecated.