<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>We run our applications with native materials for some time now
      without any issues.<br>
      <br>
      On Windows 11, it uses the Mica material for the Stage. It
      automatically adjusts based on the system theme, so you will
      always have a good look and contrast for all theme configurations.
      The mica material can also be swtiched to the acrylic one, however
      the acrylic theme was primarily intended for Windows 10 and is
      being replaced by Mica for Windows 11.<br>
      <br>
      On macOS, it uses the new Liquid Glass material in macOS 26 and
      the Vibrant material for older versions. With Liquid Glass you can
      also configure the tint if needed.<br>
      <br>
      This can all be achieved via a few native calls with the existing
      Stages, at least with the older stage styles like Unified.<br>
      <br>
      Isn't the original issue just about the extended stage style using
      a white background? I'm no expert on the implementation, but the
      other types of Stages like Unified show their background if you
      set the Scene and root node background to be transparent. Normally
      that window fill was always white anyway as JavaFX did not support
      window theming before, but if the window theme is set to something
      different, then that sticks out. Is there something fundamentally
      limiting so that the Extended stage is forced to draw a white
      background?</p>
    <p>Unified:</p>
    <p><img src="cid:part1.3R09kouW.ViUI0mmr@xpipe.io" alt=""></p>
    <p>Extended, even with DWMWA_USE_IMMERSIVE_DARK_MODE set to true:</p>
    <p><img src="cid:part2.0B84DIZv.R3zZJnmR@xpipe.io" alt=""></p>
    <div class="moz-cite-prefix">On 13/11/2025 00:33, Michael Strauß
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJEpuXSw12WMkTxjja1e8gZV4GiQypT7f0_ADwzt23OQOQiuuA@mail.gmail.com">
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">I finally got around to looking into this. I see two requests here, one to add per-pixel window transparency to EXTENDED stages and another to support backdrop materials like Windows’ Mica and Acrylic.

On the Mac adding per-pixel transparency to all stage styles is easy. On Windows it would take a lot more work and as far as I know can’t be done with the existing DX9 back end (the necessary DirectComposition API’s are tied to DX11). We would also need to reconcile platform differences related to hit testing and drop shadows. So it’s a big ask.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
I think we can probably get there by using a WS_EX_LAYERED window like
we do for StageStyle.TRANSPARENT, if we accept the significant
performance impact. With DirectComposition, we can directly interface
with the DWM composition engine and skip the GDI window surface
completely. This requires a fair bit of integration with JavaFX that
goes beyond changes in the Glass toolkit. However, it doesn't require
a D3D11 rendering pipeline. It works with the existing D3D9 pipeline
by having D3D9 render into a shared off-screen surface, which is then
accessed by DirectComposition with ID3D11Device::OpenSharedResource.



</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">(I know there’s a DX12 version of JavaFX in the works but it’s hard for me to get enthused. I run Windows in a VM and it’s likely to be stuck on DX11 for a long time.)

Supporting translucent backdrop materials is simpler since we can ask the OS to draw the effect and then composite the JavaFX content over it all within an opaque window. This is how the UNIFIED stage style works so we can leverage that logic. On Mac this is easy to set up. On Windows 11 22H2 and beyond we can easily access a couple of materials. For earlier Windows versions or for a more extensive list of materials we would need to roll our own using DirectComposition.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
That's correct, it's reasonably simple to support platform-provided
backdrop materials. Anything custom is a lot more difficult.
I have a prototype of JavaFX with DirectComposition, along with a
custom acrylic implementation. It's very old, and looks like this
(running on Windows 10):
<a class="moz-txt-link-freetext" href="https://github.com/user-attachments/assets/cd702a74-603a-4d7e-9078-52f915a4448a">https://github.com/user-attachments/assets/cd702a74-603a-4d7e-9078-52f915a4448a</a>

In the end, there doesn't seem to be much common ground between the
various OS platforms for any reasonably powerful cross-platform API.
Maybe we could have the supporting infrastructure in JavaFX, but only
exposing API in a platform-specific module (either as part of OpenJFX
or 3rd party)? This certainly requires quite a bit of work.



</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">I know nothing about DirectComposition but I’m pretty sure someone on this list has used it to prototype an Acrylic effect for JavaFX. I’ll see if I can find that e-mail. I’m particularly interested in whether this can easily be turned on and off on-the-fly and how dark mode would be handled (the platform-provided materials respond to dark mode).
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
I've never heard of any previous effort, and it couldn't have been me
beacuse I haven't talked about this up util now. I'd be interested to
learn about other attempts at solving this.
</pre>
    </blockquote>
  </body>
</html>