mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 19:28:48 +00:00
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 <andreas@ladybird.org>
This commit is contained in:
parent
52c828be2b
commit
3bbe1b0c62
Notes:
github-actions[bot]
2024-11-08 20:32:10 +00:00
Author: https://github.com/trflynn89
Commit: 3bbe1b0c62
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2235
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 2 additions and 2 deletions
|
@ -294,7 +294,7 @@ void CFEventLoopManager::register_notifier(Core::Notifier& notifier)
|
||||||
CFSocketSetSocketFlags(socket, sockopt);
|
CFSocketSetSocketFlags(socket, sockopt);
|
||||||
|
|
||||||
auto* source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
|
auto* source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
|
||||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
|
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes);
|
||||||
|
|
||||||
CFRelease(socket);
|
CFRelease(socket);
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ void CFEventLoopManager::register_notifier(Core::Notifier& notifier)
|
||||||
void CFEventLoopManager::unregister_notifier(Core::Notifier& notifier)
|
void CFEventLoopManager::unregister_notifier(Core::Notifier& notifier)
|
||||||
{
|
{
|
||||||
if (auto source = ThreadData::the().notifiers.take(¬ifier); source.has_value()) {
|
if (auto source = ThreadData::the().notifiers.take(¬ifier); source.has_value()) {
|
||||||
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), *source, kCFRunLoopDefaultMode);
|
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), *source, kCFRunLoopCommonModes);
|
||||||
CFRelease(*source);
|
CFRelease(*source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue