RFR: 8242544: CMD+ENTER key event crashes the application when invoked on dialog
Kevin Rushforth
kcr at openjdk.java.net
Wed Jan 12 16:27:29 UTC 2022
On Wed, 12 Jan 2022 16:14:58 GMT, Jose Pereda <jpereda at openjdk.org> 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.
>
> modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m line 848:
>
>> 846: // If the contentView is set to nil within performKeyEquivalent: the OS will crash.
>> 847: NSView* dummy = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 10, 10)];
>> 848: [window->nsWindow performSelectorOnMainThread:@selector(setContentView:) withObject:dummy waitUntilDone:YES];
>
> I'm not sure is needed or worth it, but maybe the `dummy` view should be released?
That's a good question.
-------------
PR: https://git.openjdk.java.net/jfx/pull/714
More information about the openjfx-dev
mailing list