RFR: 8313424: JavaFX controls in the title bar [v27]

Michael Strauß mstrauss at openjdk.org
Thu Nov 14 17:51:57 UTC 2024


On Thu, 14 Nov 2024 15:43:53 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> Michael Strauß has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 34 commits:
>> 
>>  - Merge branch 'master' into feature/extended-window
>>  - Merge branch 'master' into feature/extended-window
>>  - add system menu documentation
>>  - WindowControlsOverlay snapping
>>  - HeaderBar javadoc change
>>  - refactor performWindowDrag
>>  - HeaderBar changes
>>  - EMPTY Dimension2D constant
>>  - use CsvSource in HeaderBarTest
>>  - stylistic changes
>>  - ... and 24 more: https://git.openjdk.org/jfx/compare/d0011b21...65f095ef
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacWindow.java line 176:
> 
>> 174:                 if (eventHandler != null && eventHandler.pickDragAreaNode(wx, wy) != null) {
>> 175:                     if (clickCount == 2) {
>> 176:                         maximize(!isMaximized());
> 
> The title bar double-click behavior is user-configurable. Unfortunately the only way to get this right is to query for an undocumented but widely-known preference.
> 
> 
> NSString* action = [NSUserDefaults.standardUserDefaults stringForKey: @"AppleActionOnDoubleClick"];
> if ([action isEqualToString: @"Minimize"]) {
>     [window performMiniaturize: nil];
> }
> else if ([action isEqualToString: @"Maximize"]) {
>     [window performZoom: nil];
> }

Thanks for the suggestion!

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1605#discussion_r1842654963


More information about the openjfx-dev mailing list