chore: bump chromium to 121.0.6100.0 (main) (#40408)

* chore: bump chromium in DEPS to 121.0.6100.0

* chore: update patches

* 4970322: [X11] Move utils into x11::Connection

4970322

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
electron-roller[bot] 2023-11-01 19:01:01 -04:00 committed by GitHub
parent 83f0d2645e
commit 5200abe744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 97 additions and 119 deletions

View file

@ -45,7 +45,6 @@
#include "ui/display/util/edid_parser.h" // nogncheck
#include "ui/gfx/x/randr.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto_util.h"
#endif // defined(USE_OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_WIN)

View file

@ -73,10 +73,10 @@
#include "shell/browser/ui/x/event_disabler.h"
#include "shell/browser/ui/x/x_window_utils.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/shape.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_util.h"
#endif
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@ -372,10 +372,12 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_MODAL"));
}
if (!state_atom_list.empty())
SetArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM,
state_atom_list);
if (!state_atom_list.empty()) {
auto* connection = x11::Connection::Get();
connection->SetArrayProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM, state_atom_list);
}
// Set the _NET_WM_WINDOW_TYPE.
if (!window_type.empty())
@ -482,9 +484,10 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) {
#if defined(USE_OZONE_PLATFORM_X11)
if (IsX11()) {
const std::string color = use_dark_theme ? "dark" : "light";
x11::SetStringProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_GTK_THEME_VARIANT"),
x11::GetAtom("UTF8_STRING"), color);
auto* connection = x11::Connection::Get();
connection->SetStringProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_GTK_THEME_VARIANT"), x11::GetAtom("UTF8_STRING"), color);
}
#endif
}
@ -1396,12 +1399,14 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
NativeWindow::SetParentWindow(parent);
#if defined(USE_OZONE_PLATFORM_X11)
if (IsX11())
x11::SetProperty(
if (IsX11()) {
auto* connection = x11::Connection::Get();
connection->SetProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::Atom::WM_TRANSIENT_FOR, x11::Atom::WINDOW,
parent ? static_cast<x11::Window>(parent->GetAcceleratedWidget())
: ui::GetX11RootWindow());
}
#elif BUILDFLAG(IS_WIN)
// To set parentship between windows into Windows is better to play with the
// owner instead of the parent, as Windows natively seems to do if a parent
@ -1516,8 +1521,10 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() {
// determine whether the current window is visible on all workspaces.
x11::Atom sticky_atom = x11::GetAtom("_NET_WM_STATE_STICKY");
std::vector<x11::Atom> wm_states;
GetArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), &wm_states);
auto* connection = x11::Connection::Get();
connection->GetArrayProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), &wm_states);
return base::Contains(wm_states, sticky_atom);
}
#endif

View file

@ -13,9 +13,9 @@
#include "dbus/object_proxy.h"
#include "shell/common/thread_restrictions.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_util.h"
namespace electron {
@ -29,8 +29,9 @@ void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state) {
void SetWindowType(x11::Window window, const std::string& type) {
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
x11::Atom window_type = x11::GetAtom(type_prefix + base::ToUpperASCII(type));
x11::SetProperty(window, x11::GetAtom("_NET_WM_WINDOW_TYPE"), x11::Atom::ATOM,
window_type);
auto* connection = x11::Connection::Get();
connection->SetProperty(window, x11::GetAtom("_NET_WM_WINDOW_TYPE"),
x11::Atom::ATOM, window_type);
}
bool ShouldUseGlobalMenuBar() {