From 3bbe1b0c62c3b71fbfdd1eeb2291677e9cba1bbf Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 8 Nov 2024 13:27:10 -0500 Subject: [PATCH] UI/AppKit: Register socket notifiers in the common run loop mode When the user resizes the browser window, AppKit will spin the current run loop in the common mode. This patch allows socket events from IPC to be processed while the resize is ongoing. This includes the WebView hook to repaint. Co-Authored-By: Andreas Kling --- Ladybird/AppKit/Application/EventLoopImplementation.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ladybird/AppKit/Application/EventLoopImplementation.mm b/Ladybird/AppKit/Application/EventLoopImplementation.mm index 53dd5c36cee..b6b03677306 100644 --- a/Ladybird/AppKit/Application/EventLoopImplementation.mm +++ b/Ladybird/AppKit/Application/EventLoopImplementation.mm @@ -294,7 +294,7 @@ void CFEventLoopManager::register_notifier(Core::Notifier& notifier) CFSocketSetSocketFlags(socket, sockopt); auto* source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0); - CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); + CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes); CFRelease(socket); @@ -304,7 +304,7 @@ void CFEventLoopManager::register_notifier(Core::Notifier& notifier) void CFEventLoopManager::unregister_notifier(Core::Notifier& notifier) { if (auto source = ThreadData::the().notifiers.take(¬ifier); source.has_value()) { - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), *source, kCFRunLoopDefaultMode); + CFRunLoopRemoveSource(CFRunLoopGetCurrent(), *source, kCFRunLoopCommonModes); CFRelease(*source); } }