Skip to content

Commit

Permalink
Enable building with CEF 6261
Browse files Browse the repository at this point in the history
  • Loading branch information
WizardCM committed Feb 4, 2024
1 parent 58c7365 commit b8838ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 12 additions & 2 deletions browser-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ void BrowserApp::ExecuteJSFunction(CefRefPtr<CefBrowser> browser,
std::vector<CefString> names;
browser->GetFrameNames(names);
for (auto &name : names) {
CefRefPtr<CefFrame> frame = browser->GetFrame(name);
CefRefPtr<CefFrame> frame =
#if CHROME_VERSION_BUILD >= 6261
browser->GetFrameByName(name);
#else
browser->GetFrame(name);
#endif
CefRefPtr<CefV8Context> context = frame->GetV8Context();

context->Enter();
Expand Down Expand Up @@ -346,7 +351,12 @@ bool BrowserApp::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
std::vector<CefString> names;
browser->GetFrameNames(names);
for (auto &name : names) {
CefRefPtr<CefFrame> frame = browser->GetFrame(name);
CefRefPtr<CefFrame> frame =
#if CHROME_VERSION_BUILD >= 6261
browser->GetFrameByName(name);
#else
browser->GetFrame(name);
#endif
CefRefPtr<CefV8Context> context = frame->GetV8Context();

context->Enter();
Expand Down
2 changes: 2 additions & 0 deletions obs-browser-page/obs-browser-page-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
std::thread shutdown_check;

CefMainArgs mainArgs(nullptr);
#if CHROME_VERSION_BUILD < 5615
if (!SetHighDPIv2Scaling())
CefEnableHighDPISupport();
#endif

CefRefPtr<CefCommandLine> command_line =
CefCommandLine::CreateCommandLine();
Expand Down
5 changes: 4 additions & 1 deletion obs-browser-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,12 @@ bool obs_module_load(void)

os_event_init(&cef_started_event, OS_EVENT_TYPE_MANUAL);

#ifdef _WIN32
#if defined(_WIN32) && CHROME_VERSION_BUILD < 5615
/* CefEnableHighDPISupport doesn't do anything on OS other than Windows. Would also crash macOS at this point as CEF is not directly linked */
CefEnableHighDPISupport();
#endif

#ifdef _WIN32
EnumAdapterCount();
#else
#if defined(__APPLE__) && !defined(ENABLE_BROWSER_LEGACY)
Expand Down

0 comments on commit b8838ad

Please sign in to comment.