Suggestions for StageStyle.UNIFIED on macOS
Martin Fox
martin at martinfox.com
Mon Jul 17 23:35:38 UTC 2023
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.stenzel at 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.stenzel at 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 <martin at martinfox.com <mailto:martin at 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.
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230717/ab5bcfdd/attachment.htm>
More information about the openjfx-dev
mailing list