On Thu, 22 Jan 2026 18:58:58 GMT, Michael Strauß <[email protected]> wrote:
>> I agree that an enum is inadequate. The two API's we have to work with >> (macOS and Win11) are based on enums; you specify the type of window or >> content (e.g. tooltip, menu, sidebar, window) and let the OS decide what >> material to use. macOS pro-actively enumerates a lot of different window >> types though it looks like many of them map to the same material under the >> hood. I'm not entirely sure the glass effect recently added to macOS is >> appropriate for JavaFX but it is a prime example of a specialized >> platform-specific backdrop that can't easily be squeezed into an enum. >> >> So, yes, we should expand StageBackdrop so we can provide more information. >> How to do that might be beyond my pay grade (I'm not a Java expert). I don't >> think the existing `Platform.isSupported()` API would be appropriate since >> it takes a separate enum type. > >> Should we have a (new kind of) fallback system, or should we do this with >> the existing `Platform.isSupported(ConditionalFeature)` and have the user >> decide based on the result of that function? > > Expanding on that question: if we have platform-specific backdrops that may > have a big impact on styling and readability, stylesheets may want to query > the actual backdrop used via media queries. The platforms seem to assume you'll draw content on the backdrop using the PlatformPreference colors (there's no way of asking the platforms for backdrop-specific color information). But it still might be good for the stylesheets to know which backdrop is in effect. A more interesting question is whether a stylesheet can ask for a backdrop to be applied. The CSS machinery isn't set up for this; it's designed to apply styles to nodes, not windows (AFIK). And you probably don't want to apply a backdrop to, say, a menu or tooltip since the backdrop would fill the entire stage forcing it to be rectangular (no rounded corners). If the CSS called for a drop shadow the backdrop would be behind the shadow. I considered ways of fixing this but didn't come up with a workable solution. I'll be traveling for a few days so it might be a while before I re-enter the conversation. Thanks for all the feedback! ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2048#discussion_r2718524353
