You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: the first browser source created off the main thread (obs-websocket) never renders: CEF initializes on that thread #2387
On macOS, when the first browser source of a session is created outside the Qt main thread, for example by obs-websocket's CreateInput, CEF initializes on that thread and no browser source renders for the rest of the session. A first browser source added in the UI (on the main thread) renders. Seen with a local build of master f598d234d (obs-browser 4583599 plus the #2386 fix), CEF 7871, macOS 26.7.1, Apple Silicon.
Cause
On macOS obs-browser runs CEF on Qt's main loop (ENABLE_BROWSER_QT_LOOP). The browser source's create callback calls obs_browser_initialize(), which then calls BrowserInit() and so CefInitialize() directly, on the calling thread (obs-browser-plugin.cpp, obs_browser_initialize() and RegisterBrowserSource()). Without the Qt loop (Linux, Windows) it starts its own CEF thread instead. When obs-websocket creates the first source, the calling thread is its IO thread, so CEF's UI thread is one that never pumps CEF's message loop.
What I saw
First source through obs-websocket CreateInput (local file or https://example.com): only the GPU process starts, no renderer, the source stays black. CEF's log stops after the profile is created (ProfileManager ... ClearFirstBrowserWindowKeepAlive(Default)), and 15 s later the started helpers exit: Terminating current process after 15 seconds with no connection.BrowserApp::OnContextInitialized() never runs.
The same with the source created 20 s after startup, and with OBS the active app: not a timing or App Nap effect.
First source added in the UI with https://example.com: it renders; the GPU, two utility and two renderer processes start.
Source created through obs-websocket first, then Properties → OK, and then a new URL, in the UI: still black, still only the GPU process. CEF stays unusable for the whole session.
obs-rust/obs-browser 0c3b700 is not the cause: setting cef_started_event right after CefInitialize() again does not change it.
Fix
In the Qt-loop build, run BrowserInit() on the Qt main thread whatever thread calls obs_browser_initialize() (for example QMetaObject::invokeMethod(qApp, ..., Qt::BlockingQueuedConnection) when not on the main thread). This code path is the same as upstream's, so upstream OBS is likely affected too.
Acceptance criteria
RED then GREEN: a test where the first browser source is created off the main thread on macOS, and it renders.
On macOS, a first browser source created through obs-websocket renders, and so do later ones.
changed the title [-]macOS: browser sources never render: CEF's message pump does not run on the Qt loop[/-][+]macOS: the first browser source created off the main thread (obs-websocket) never renders: CEF initializes on that thread[/+]on Oct 25, 2026
Correction: the first version of this issue said browser sources never render on macOS. That was wrong. With the helper names of #2386 fixed, a browser source added in the UI renders. The failure only happens when the first browser source of a session is created off the main thread (obs-websocket in my tests), so I rewrote the title and description with the narrowed cause and the tests that show it.
The cause is in the description; this claim covers the fix. Plan:
RED in obs-rust/obs-browser: a local test in tests/ (macOS, like the other local tests there that run real CEF) that starts OBS, creates the first browser source through obs-websocket, and requires it to render. It fails today.
GREEN: in the Qt-loop build, obs_browser_initialize() runs BrowserInit() on the Qt main thread when it is called from another thread (QMetaObject::invokeMethod(..., Qt::BlockingQueuedConnection)).
A real run on macOS: a first source through obs-websocket renders, and a first source added in the UI still does. Then the submodule bump here.
Activity
[-]macOS: browser sources never render: CEF's message pump does not run on the Qt loop[/-][+]macOS: the first browser source created off the main thread (obs-websocket) never renders: CEF initializes on that thread[/+]vpacher commentedon Oct 25, 2026
Correction: the first version of this issue said browser sources never render on macOS. That was wrong. With the helper names of #2386 fixed, a browser source added in the UI renders. The failure only happens when the first browser source of a session is created off the main thread (obs-websocket in my tests), so I rewrote the title and description with the narrowed cause and the tests that show it.
vpacher commentedon Oct 25, 2026
Claiming: investigation
The cause is in the description; this claim covers the fix. Plan:
tests/(macOS, like the other local tests there that run real CEF) that starts OBS, creates the first browser source through obs-websocket, and requires it to render. It fails today.obs_browser_initialize()runsBrowserInit()on the Qt main thread when it is called from another thread (QMetaObject::invokeMethod(..., Qt::BlockingQueuedConnection)).Initialize CEF on the Qt main thread on macOS (#10)
obs-browser: Update to 9aa4a60 (macOS helper names, CEF on the main t…
macos: Name the browser helpers after the app, start CEF on the main …
obs-browser: Update to 63fd678 (macOS sandbox, no hang on quit) (obs-…