RFR: 8242544: CMD+ENTER key event crashes the application when invoked on dialog [v2]

Kevin Rushforth kcr at openjdk.java.net
Wed Jan 12 18:27:33 UTC 2022


On Wed, 12 Jan 2022 16:56:12 GMT, Martin Fox <duke at openjdk.java.net> wrote:

>> The OS crashes if the contentView of a window is set to nil while handling processKeyEquivalent. With this PR we just set the contentView to a basic do-nothing NSView for the interim.
>
> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Releasing dummy NSView

Marked as reviewed by kcr (Lead).

modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m line 849:

> 847:             NSView* dummy = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 10, 10)];
> 848:             [window->nsWindow performSelectorOnMainThread:@selector(setContentView:) withObject:dummy waitUntilDone:YES];
> 849:             [dummy release];

This looks fine, given that we wait until the previous call to `performSelectorOnMainThread` is done.

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

PR: https://git.openjdk.java.net/jfx/pull/714


More information about the openjfx-dev mailing list