mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-3575 use flag processEvents in LWCToolkit.invokeAndWait
(cherry picked from commit dcf9ff3315)
This commit is contained in:
@@ -710,6 +710,12 @@ public final class LWCToolkit extends LWToolkit {
|
||||
|
||||
public static void invokeAndWait(Runnable runnable, Component component, int timeoutSeconds)
|
||||
throws InvocationTargetException
|
||||
{
|
||||
invokeAndWait(runnable, component, false, -1);
|
||||
}
|
||||
|
||||
public static void invokeAndWait(Runnable runnable, Component component, boolean processEvents, int timeoutSeconds)
|
||||
throws InvocationTargetException
|
||||
{
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("invokeAndWait started: " + runnable);
|
||||
@@ -759,7 +765,7 @@ public final class LWCToolkit extends LWToolkit {
|
||||
invocationEvent.onDone(() -> eventDispatchThreadFreeFuture.cancel(false));
|
||||
}
|
||||
|
||||
if (!doAWTRunLoop(mediator, false, timeoutSeconds)) {
|
||||
if (!doAWTRunLoop(mediator, processEvents, timeoutSeconds)) {
|
||||
invocationEvent.dispose("InvocationEvent has timed out");
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#import "sun_lwawt_macosx_LWCToolkit.h"
|
||||
|
||||
#import "sizecalc.h"
|
||||
#import "AWTWindow.h"
|
||||
|
||||
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
|
||||
|
||||
@@ -612,7 +613,11 @@ JNI_COCOA_ENTER(env);
|
||||
untilDate:nil
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue:YES]) != nil) {
|
||||
[NSApp sendEvent:event];
|
||||
if ([event.window isKindOfClass:[AWTWindow_Normal class]]) {
|
||||
// Filter only events from AWTWindow (to skip events from ScreenMenu)
|
||||
// See https://youtrack.jetbrains.com/issue/IDEA-305287/Implement-non-blocking-ScreenMenu.invokeOpenLater#focus=Comments-27-6614719.0-0
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user