RFR: 8273485: Deadlock when also using Swing and exiting Fullscreen on Mac [v7]
Florian Kirmaier
fkirmaier at openjdk.java.net
Fri Oct 29 10:57:16 UTC 2021
On Mon, 18 Oct 2021 08:20:22 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:
>> When using Swing it's possible to generate a Deadlock.
>> It's related to the nested eventloop started in enterFullScreenExitingLoop - and the RenderLock aquired when using setView in Scene.
>> Sample Programm and Threaddump are added to the ticket.
>>
>> Removing the nested loop fixes the Problem.
>> I hope this doesn't have any side effect - so far i don't know of any.
>
> Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
>
> JDK-8273485
> Fixing toggle fullscreen!
#### not a real regression
I think I've hunted a regression, which was none. When closing the application with `System.exit` the screen gets red, but this isn't caused by my change.
I've even got a fix for it, but it requires changing the lifecycle slightly, by closing all windows on shutdown. (And some other minor changes to fix some exceptions)
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
System.out.println("tkExit shutdown hook!");
PlatformImpl.tkExit();
}));
But because this isn't caused by my changes, we can therefore ignore it. But I had to mention it because I invested too much time into it.
#### toggle
I've readded the toggle code. It's worth mentioning that the code is different than before.
The original version caused a "beep sound" when closing the window `[self->nativeFullScreenModeWindow performSelector:@selector(toggleFullScreen:) withObject:nil];`
The new version doesn't have this problem - but it's also fixing the problem from the previous version. `[[self->nsView window] toggleFullScreen:self];`
#### exception
With the current version, I also cannot reproduce the problem, with the exception.
-------------
PR: https://git.openjdk.java.net/jfx/pull/622
More information about the openjfx-dev
mailing list