Skip to content

Commit cffac27

Browse files
committed
mac: Fix CEF message pump during modal tracking (see #443)
Use performSelector:onThread:withObject:waitUntilDone:modes: with both NSDefaultRunLoopMode and NSEventTrackingRunLoopMode to ensure CEF's message loop work is processed during modal operations like window resize and close.
1 parent 2c8f1d1 commit cffac27

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

native/util_mac.mm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,12 @@ void CefShutdownOnMainThread() {
456456
}
457457

458458
void CefDoMessageLoopWorkOnMainThread() {
459-
[[CefHandler class] performSelectorOnMainThread:@selector(doMessageLoopWork)
460-
withObject:nil
461-
waitUntilDone:NO];
459+
[[CefHandler class]
460+
performSelector:@selector(doMessageLoopWork)
461+
onThread:[NSThread mainThread]
462+
withObject:nil
463+
waitUntilDone:NO
464+
modes:@[ NSDefaultRunLoopMode, NSEventTrackingRunLoopMode ]];
462465
}
463466

464467
void SetVisibility(CefWindowHandle handle, bool isVisible) {

0 commit comments

Comments
 (0)