Skip to content

Commit

Permalink
Enable building with CEF 6533 & 6613
Browse files Browse the repository at this point in the history
Chromium 128 removes the `persist_user_preferences` setting entirely.

Chrome runtime is used by default, so to disable 'Cast..' and more,
explicitly use the Alloy runtime.

DevTools popups can no longer be windowless.
  • Loading branch information
WizardCM committed Aug 1, 2024
1 parent 75d3eb1 commit d18fc7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions obs-browser-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ static void BrowserInit(void)
BPtr<char> conf_path_abs = os_get_abs_path_ptr(conf_path);
CefString(&settings.locale) = obs_get_locale();
CefString(&settings.accept_language_list) = accepted_languages;
#if CHROME_VERSION_BUILD <= 6533
settings.persist_user_preferences = 1;
#endif
CefString(&settings.cache_path) = conf_path_abs;
#if !defined(__APPLE__) || defined(ENABLE_BROWSER_LEGACY)
char *abs_path = os_get_abs_path_ptr(path.c_str());
Expand Down
2 changes: 1 addition & 1 deletion panel/browser-panel-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ bool QCefBrowserClient::OnContextMenuCommand(
QString title;
switch (command_id) {
case MENU_ITEM_DEVTOOLS:
#if defined(_WIN32)
#if defined(_WIN32) && CHROME_VERSION_BUILD < 6533
title = QString(obs_module_text("DevTools"))
.arg(widget->parentWidget()->windowTitle());
windowInfo.SetAsPopup(host->GetWindowHandle(),
Expand Down
8 changes: 8 additions & 0 deletions panel/browser-panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ struct QCefCookieManagerInternal : QCefCookieManager {
BPtr<char> path = os_get_abs_path_ptr(rpath.Get());

CefRequestContextSettings settings;
#if CHROME_VERSION_BUILD <= 6533
settings.persist_user_preferences = 1;
#endif
CefString(&settings.cache_path) = path.Get();
rc = CefRequestContext::CreateContext(
settings, CefRefPtr<CefRequestContextHandler>());
Expand All @@ -107,7 +109,9 @@ struct QCefCookieManagerInternal : QCefCookieManager {
BPtr<char> path = os_get_abs_path_ptr(rpath.Get());

CefRequestContextSettings settings;
#if CHROME_VERSION_BUILD <= 6533
settings.persist_user_preferences = 1;
#endif
CefString(&settings.cache_path) = storage_path;
rc = CefRequestContext::CreateContext(
settings, CefRefPtr<CefRequestContextHandler>());
Expand Down Expand Up @@ -314,6 +318,10 @@ void QCefWidgetInternal::Init()
QSize size = this->size();
#endif

#if CHROME_VERSION_BUILD >= 6533
windowInfo.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
#endif

#if CHROME_VERSION_BUILD < 4430
#ifdef __APPLE__
windowInfo.SetAsChild((CefWindowHandle)handle, 0, 0,
Expand Down

0 comments on commit d18fc7a

Please sign in to comment.