Sebastian,

I submitted a draft implementation of the COMBINED StageStyle in PR #1192. On 
Mac and Windows it allows JavaFX controls to overlap the platform window 
decorations in the title bar.

On the Mac you can get most of the way there by setting two flags, one to 
extend the JavaFX scene into the title bar area and the other to hide the 
platform title bar (otherwise it overlaps and blurs the JavaFX content). Most 
of the rest of the code is there just to get the stoplight controls positioned 
correctly.

Windows requires even less work but the results are underwhelming since Windows 
10 provides such limited support for customizing the title bar. The standard 
approach seems to be to just roll an entirely custom bar, buttons and all.

I think I know how to approach this on Linux but the solution will be more 
involved.

Martin

> On Jul 17, 2023, at 4:35 PM, Martin Fox <mar...@martinfox.com> wrote:
> 
> Ignore my earlier comments on UNIFIED since I didn’t understand it. All 
> UNIFIED did was alter the way the window background was drawn to support the 
> “sheet of glass” effect introduced in Windows Vista and the equivalent 
> brushed metal effect on Mac (which I think dates back to Panther). As far as 
> I can tell it worked fine on both platforms but Microsoft and Apple removed 
> those visuals a long time ago.
> 
> On Mac and Windows I’ve prototyped a different stage style (COMBINED) which 
> is closer to what you want. It extends the JavaFX stage into the titlebar 
> area so JavaFX controls can co-exist with the platform decorations. I’ve been 
> meaning to submit this as a draft PR for comment but got side-tracked by 
> other projects (including my keyboard-related PR’s which are still working 
> their way through the review process). I’ll try to get it cleaned up and 
> submit a PR in the next couple of weeks.
> 
> Martin
> 
>> On Jul 17, 2023, at 7:56 AM, Sebastian Stenzel <sebastian.sten...@gmail.com> 
>> wrote:
>> 
>> Other than announced, there wasn't any intend to deprecated 
>> `StageStyle.UNIFIED` yet. So I was wondering what is the status here? My 
>> suggestion to actually make it work (at least on one platform [1]) didn't 
>> seem to whip up much enthusiasm either.
>> 
>> I'm still open to invest time into this feature, but not without any 
>> reliable info about what is the plan for window decorations. Is any strategy 
>> in which direction OpenJFX should evolve? Or if you allow me to ask a bit of 
>> a cynical question: Are desktop apps still of interest? ;-)
>> 
>> [1] https://gist.github.com/overheadhunter/29af68f4c4eb7de28dd4a3a4772a0f09
>> 
>>> Am 09.02.2022 um 13:22 schrieb Sebastian Stenzel 
>>> <sebastian.sten...@gmail.com>:
>>> 
>>> Since there aren't any further comments on this, I assume there isn't much 
>>> interest in this. Deprecating it is probably the right move, if it never 
>>> worked as intended on any platform. I think I'm going to try and get this 
>>> working as some kind of library instead.
>>> 
>>>> On 3. Feb 2022, at 20:55, Martin Fox <mar...@martinfox.com 
>>>> <mailto:mar...@martinfox.com>> wrote:
>>>> 
>>>> I took a look at this and discovered that UNIFIED doesn’t really work on 
>>>> any platform. It was never supported on Linux, the Mac implementation 
>>>> doesn’t really unify anything, and Windows is broken (see JDK-8154847 
>>>> <https://bugs.openjdk.java.net/browse/JDK-8154847>). In that bug report 
>>>> it’s suggested that UNIFIED be deprecated.
>>>> 
>>>> I don’t think the UNIFIED API was ever complete. For example, I don’t see 
>>>> a way of querying the system to discover the location of the OS window 
>>>> controls so you can position your JavaFX controls appropriately.
>>>> 
>>>> Getting this right on the Mac would require some plumbing. We would need 
>>>> an API so we know which JavaFX controls are supposed to be in the unified 
>>>> title bar area so we can get the hit-testing right to enable dragging, 
>>>> title bar double-clicks, etc. I could imagine a new control that you could 
>>>> wrap around an existing control (like a Toolbar) that would handle the 
>>>> hit-testing and positioning correctly. I’m fuzzier on what it would take 
>>>> on Windows and there’s still the drawing problems to sort out.
>>>> 
>>>> Would be nice to have, the unified look is ascendant.
>>>> 
>>>> 
>>>> 
>>> 
>> 
> 

Reply via email to