chore: bump chromium to 140.0.7339.16 (38-x-y) (#48075)

* chore: bump chromium in DEPS to 140.0.7339.16

* chore: update patches

* Remove ELECTRON_OZONE_PLATFORM_HINT env var

6819616: Remove OzonePlatformHint | https://chromium-review.googlesource.com/c/chromium/src/+/6819616

See: https://github.com/electron/electron/issues/48001
(cherry picked from commit d9dad4305092f5022fd493ca8b5d5d7af60a0b24)

* Remove `DESKTOP_STARTUP_ID` code

This was removed upstream in https://chromium-review.googlesource.com/c/chromium/src/+/6819616 and I confirmed with the author that it was an intentional change. Going to mirror upstream and remove it here too.

(cherry picked from commit 8fffb83c1179131f7b4952fb6a52b735eb34f705)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
electron-roller[bot] 2025-08-19 21:04:49 -04:00 committed by GitHub
commit fead821311
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 39 additions and 192 deletions

2
DEPS
View file

@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = { vars = {
'chromium_version': 'chromium_version':
'140.0.7339.2', '140.0.7339.16',
'node_version': 'node_version':
'v22.18.0', 'v22.18.0',
'nan_version': 'nan_version':

View file

@ -125,16 +125,6 @@ Options:
* `kioclient5` * `kioclient5`
* `kioclient` * `kioclient`
### `ELECTRON_OZONE_PLATFORM_HINT` _Linux_ _Deprecated_
Selects the preferred platform backend used on Linux. `auto` selects Wayland if possible, X11 otherwise.
Options:
* `auto` (Default)
* `wayland`
* `x11`
## Development Variables ## Development Variables
The following environment variables are intended primarily for development and The following environment variables are intended primarily for development and

View file

@ -14,14 +14,12 @@ This document uses the following convention to categorize breaking changes:
## Planned Breaking API Changes (38.0) ## Planned Breaking API Changes (38.0)
### Deprecated: `ELECTRON_OZONE_PLATFORM_HINT` environment variable ### Removed: `ELECTRON_OZONE_PLATFORM_HINT` environment variable
The default value of the `--ozone-plaftform` flag [changed to `auto`](https://chromium-review.googlesource.com/c/chromium/src/+/6775426). The default value of the `--ozone-plaftform` flag [changed to `auto`](https://chromium-review.googlesource.com/c/chromium/src/+/6775426).
You should use the `XDG_SESSION_TYPE=wayland` environment variable instead to use Wayland. You should use the `XDG_SESSION_TYPE=wayland` environment variable instead to use Wayland.
This environment variable will be [removed soon](https://chromium-review.googlesource.com/c/chromium/src/+/6819616).
### Removed: macOS 11 support ### Removed: macOS 11 support
macOS 11 (Big Sur) is no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/6594615). macOS 11 (Big Sur) is no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/6594615).

View file

@ -23,7 +23,6 @@ filenames = {
lib_sources_linux = [ lib_sources_linux = [
"shell/browser/browser_linux.cc", "shell/browser/browser_linux.cc",
"shell/browser/electron_browser_main_parts_linux.cc",
"shell/browser/lib/power_observer_linux.cc", "shell/browser/lib/power_observer_linux.cc",
"shell/browser/lib/power_observer_linux.h", "shell/browser/lib/power_observer_linux.h",
"shell/browser/linux/unity_service.cc", "shell/browser/linux/unity_service.cc",

View file

@ -33,10 +33,10 @@ index e648bb4ed2ff72441faa8773e449e0b6174f5af5..fd2c1d3ac575d10de7d5c09e4418d172
"//base", "//base",
"//build:branding_buildflags", "//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 9c4efeae559f3f752ea9f83904417a35ef436434..ed40f8c920714e6c241cedcbbff6b38ad311489b 100644 index 1e937348e3210b4a3cf2762cfd7cafd27650ffaf..4dcfbbeb833b3483eed61b8eb98636fe69ee6d5a 100644
--- a/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -4753,7 +4753,7 @@ static_library("browser") { @@ -4755,7 +4755,7 @@ static_library("browser") {
] ]
} }
@ -46,7 +46,7 @@ index 9c4efeae559f3f752ea9f83904417a35ef436434..ed40f8c920714e6c241cedcbbff6b38a
# than here in :chrome_dll. # than here in :chrome_dll.
deps += [ "//chrome:packed_resources_integrity_header" ] deps += [ "//chrome:packed_resources_integrity_header" ]
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index b950e537f5fc2d8fd6137d9c9131858404e78d9c..dde9dfd95521ceac67dced54efe90e5068eba797 100644 index 5e1202bd2a9118bdefe15be41a53c261c77aca62..2882d4546a3fc335e7889fa8ac15d8143a8f83ad 100644
--- a/chrome/test/BUILD.gn --- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -7455,9 +7455,12 @@ test("unit_tests") { @@ -7455,9 +7455,12 @@ test("unit_tests") {

View file

@ -9,7 +9,7 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken. TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 04ab9256afe51df82b2c5a34334a7e98f49bc82a..861468d545856eb894b3eaae943028b954c83b82 100644 index 0a02467f8dff5278b5cc530f6d08b2402b52098d..d1bfad9bfdcb44b8988a6250b71e15d191134ba8 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc --- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -9816,6 +9816,7 @@ void RenderFrameHostImpl::CreateNewWindow( @@ -9816,6 +9816,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@ -77,10 +77,10 @@ index fc433c5802ecb880f3f144f09c3d318814672213..6a1e1f2cfc60451bb097b3625245fbfb
// Operation result when the renderer asks the browser to create a new window. // Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 5fb9980e5f7672a9b518776bcfc9e54726d24a62..707b3ca716d5654ddfcf40f43582524e0c2b6492 100644 index 689203b138adf10a27c47dea61d3fe352df80b1e..2988ef70882ed30105d888491feb88db429c85ca 100644
--- a/content/public/browser/content_browser_client.cc --- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -862,6 +862,8 @@ bool ContentBrowserClient::CanCreateWindow( @@ -867,6 +867,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name, const std::string& frame_name,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,
@ -90,7 +90,7 @@ index 5fb9980e5f7672a9b518776bcfc9e54726d24a62..707b3ca716d5654ddfcf40f43582524e
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) { bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 7e953576d8be22f2efa49ee8eb349ddab63fd276..84b2ec91bc0ec42f74e91c4d4a9d71b0ffc0bcd8 100644 index ff5eca7750ef324cd036251affc0263f230710bb..f9372f547ef0d5914ba53b75aba44580a573fba0 100644
--- a/content/public/browser/content_browser_client.h --- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -199,6 +199,7 @@ class NetworkService; @@ -199,6 +199,7 @@ class NetworkService;
@ -101,7 +101,7 @@ index 7e953576d8be22f2efa49ee8eb349ddab63fd276..84b2ec91bc0ec42f74e91c4d4a9d71b0
} // namespace network } // namespace network
namespace sandbox { namespace sandbox {
@@ -1428,6 +1429,8 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -1435,6 +1436,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name, const std::string& frame_name,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,

View file

@ -61,10 +61,10 @@ index dcda976f4c3cc0ba6bcf015d5bf7435df009ae30..13cfa18bf406f244ec361a1230ccce44
Widget* GetWidget(); Widget* GetWidget();
const Widget* GetWidget() const; const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index eb1bc6840fcf026ed2ab902bae534607af84abee..88a4eeea8ff5226600c804c6df5832f93585b327 100644 index 3637176c05a7074cb9042b74f7c9ea2e29af5ee5..3ed583cf09dec0ae83c3c9449e6ef7e1fa92aa8d 100644
--- a/ui/views/win/hwnd_message_handler.cc --- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -3220,15 +3220,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -3239,15 +3239,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
} }
// We must let Windows handle the caption buttons if it's drawing them, or // We must let Windows handle the caption buttons if it's drawing them, or
// they won't work. // they won't work.
@ -86,7 +86,7 @@ index eb1bc6840fcf026ed2ab902bae534607af84abee..88a4eeea8ff5226600c804c6df5832f9
return 0; return 0;
} }
} }
@@ -3251,6 +3255,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -3270,6 +3274,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
// handle alt-space, or in the frame itself. // handle alt-space, or in the frame itself.
is_right_mouse_pressed_on_caption_ = false; is_right_mouse_pressed_on_caption_ = false;
ReleaseCapture(); ReleaseCapture();
@ -94,7 +94,7 @@ index eb1bc6840fcf026ed2ab902bae534607af84abee..88a4eeea8ff5226600c804c6df5832f9
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu() // |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
// expect screen coordinates. // expect screen coordinates.
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param); POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
@@ -3258,7 +3263,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -3277,7 +3282,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
w_param = static_cast<WPARAM>(SendMessage( w_param = static_cast<WPARAM>(SendMessage(
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y))); hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
if (w_param == HTCAPTION || w_param == HTSYSMENU) { if (w_param == HTCAPTION || w_param == HTSYSMENU) {

View file

@ -7,7 +7,7 @@ Electron does not support Profiles, so we need to patch it out of any
code that we use. code that we use.
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
index e3b9f14a4cf2167064ce6716053e663adffa1542..65f13a4607c8145858fd47d81cb9960c44272d79 100644 index c390a83277f564f1a67a7dcffa36b9d77a35bc0b..b13273a4b194ad5e8ca2d1639ebca831f9607b1e 100644
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc --- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc +++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
@@ -45,6 +45,7 @@ namespace { @@ -45,6 +45,7 @@ namespace {

View file

@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511 Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 3202822020573106b0ee2305f08971b3b542be69..9a033cb1f48288802fb349e885a152952fe95b98 100644 index e08dddd88f7787884f0162966db6297c67d92770..847e6a6941486879972fb593ce510a4b76c8b72e 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc --- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1941,6 +1941,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( @@ -1947,6 +1947,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
loader_factory_bundle_info = loader_factory_bundle_info =
context()->loader_factory_bundle_for_update_check()->Clone(); context()->loader_factory_bundle_for_update_check()->Clone();
@ -38,7 +38,7 @@ index 3202822020573106b0ee2305f08971b3b542be69..9a033cb1f48288802fb349e885a15295
if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig( if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
browser_context(), scope)) { browser_context(), scope)) {
// If this is a Service Worker for a WebUI, the WebUI's URLDataSource // If this is a Service Worker for a WebUI, the WebUI's URLDataSource
@@ -1960,9 +1980,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( @@ -1966,9 +1986,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeScheme) && features::kEnableServiceWorkersForChromeScheme) &&
scope.scheme_piece() == kChromeUIScheme) { scope.scheme_piece() == kChromeUIScheme) {
config->RegisterURLDataSource(browser_context()); config->RegisterURLDataSource(browser_context());
@ -49,7 +49,7 @@ index 3202822020573106b0ee2305f08971b3b542be69..9a033cb1f48288802fb349e885a15295
.emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory( .emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
browser_context(), kChromeUIScheme, browser_context(), kChromeUIScheme,
base::flat_set<std::string>())); base::flat_set<std::string>()));
@@ -1970,9 +1988,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( @@ -1976,9 +1994,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeUntrusted) && features::kEnableServiceWorkersForChromeUntrusted) &&
scope.scheme_piece() == kChromeUIUntrustedScheme) { scope.scheme_piece() == kChromeUIUntrustedScheme) {
config->RegisterURLDataSource(browser_context()); config->RegisterURLDataSource(browser_context());

View file

@ -19,10 +19,10 @@ index 671960fb876b656abc572664cd1f28492c799123..896721c02c1cf0dac03d98b152af210e
excluded_margin); excluded_margin);
} }
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 6c7e1291817f3eea03da90c206bd5b3a9b9d9beb..16efdf8effa060e489ba02f0cc086bfb0246cc26 100644 index df17e97666de639f05b92a79ee7fbd4a3da6c64f..f404c718e0242ec9269e7d14eb236aa928fb5d58 100644
--- a/ui/views/win/hwnd_message_handler.cc --- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -1049,8 +1049,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, @@ -1050,8 +1050,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio, void HWNDMessageHandler::SetAspectRatio(float aspect_ratio,
const gfx::Size& excluded_margin) { const gfx::Size& excluded_margin) {

View file

@ -312,7 +312,7 @@ index 7e3d46902fbf736b4240eb3fcb89975a7b222197..57fdc89fc265ad70cb0bff8443cc1026
auto DrawAsSinglePath = [&]() { auto DrawAsSinglePath = [&]() {
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 5b4a8a932a360b0fb3c9a488c8d97c44b4c77ed6..ab8677509fe77f16c0bc67333fa9967fb8ef4564 100644 index f4784c62cca71fe5f6334d53336db530d6f313b0..ae17298da83ed8fcb505e5f9e07f682a4624ff13 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -214,6 +214,10 @@ @@ -214,6 +214,10 @@

View file

@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
BrowserWindow. BrowserWindow.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 16efdf8effa060e489ba02f0cc086bfb0246cc26..eb1bc6840fcf026ed2ab902bae534607af84abee 100644 index f404c718e0242ec9269e7d14eb236aa928fb5d58..3637176c05a7074cb9042b74f7c9ea2e29af5ee5 100644
--- a/ui/views/win/hwnd_message_handler.cc --- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -3824,15 +3824,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, @@ -3843,15 +3843,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
delegate_->GetMinMaxSize(&min_window_size, &max_window_size); delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
min_window_size = delegate_->DIPToScreenSize(min_window_size); min_window_size = delegate_->DIPToScreenSize(min_window_size);
max_window_size = delegate_->DIPToScreenSize(max_window_size); max_window_size = delegate_->DIPToScreenSize(max_window_size);

View file

@ -13,10 +13,10 @@ messages in the legacy window handle layer.
These conditions are regularly hit with WCO-enabled windows on Windows. These conditions are regularly hit with WCO-enabled windows on Windows.
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd00c817e37 100644 index 475629d48e8807547e0c79f6fa00d458bac3416c..97f4520fbf7797b19747b5101097d93cf475fb5c 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc --- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc +++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -366,12 +366,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message, @@ -375,12 +375,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
WPARAM w_param, WPARAM w_param,
LPARAM l_param, LPARAM l_param,
BOOL& handled) { BOOL& handled) {
@ -31,7 +31,7 @@ index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd0
tme.hwndTrack = hwnd(); tme.hwndTrack = hwnd();
tme.dwHoverTime = 0; tme.dwHoverTime = 0;
TrackMouseEvent(&tme); TrackMouseEvent(&tme);
@@ -404,7 +404,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message, @@ -413,7 +413,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
// the picture. // the picture.
if (!handled && if (!handled &&
(message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) { (message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) {
@ -44,7 +44,7 @@ index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd0
} }
return ret; return ret;
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.h b/content/browser/renderer_host/legacy_render_widget_host_win.h diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.h b/content/browser/renderer_host/legacy_render_widget_host_win.h
index 17952b4b6ab559ba1c9076b100b060a7011edeec..1eda20e67d3b3184bec154f24c4259bb4a49b099 100644 index f9699ff0abf9036e9e1cabf626aa6395584cf896..94a8a50cb630182103c4256352d7a8a2acc8c76a 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.h --- a/content/browser/renderer_host/legacy_render_widget_host_win.h
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.h +++ b/content/browser/renderer_host/legacy_render_widget_host_win.h
@@ -105,6 +105,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND @@ -105,6 +105,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND

View file

@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue
for opaque frameless windows even with that block commented out. for opaque frameless windows even with that block commented out.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 88a4eeea8ff5226600c804c6df5832f93585b327..45b9be8cef981c570f7975f4bbd1d6d2fcc39afb 100644 index 3ed583cf09dec0ae83c3c9449e6ef7e1fa92aa8d..1287e9eda295061a7ee9b758b3c0618933896d82 100644
--- a/ui/views/win/hwnd_message_handler.cc --- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -1856,7 +1856,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { @@ -1857,7 +1857,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
0); 0);

View file

@ -36,10 +36,10 @@ index d8be4dffee3947e7ac6dc09cb8e1f2a6a834789b..8eb539af74c1934a55f9b14ad97dd93b
// Overridden from DesktopWindowTreeHost: // Overridden from DesktopWindowTreeHost:
void Init(const Widget::InitParams& params) override; void Init(const Widget::InitParams& params) override;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010b9ca95df 100644 index 1287e9eda295061a7ee9b758b3c0618933896d82..e2b899dd25c12448068c99f1344cba4fea26e2c6 100644
--- a/ui/views/win/hwnd_message_handler.cc --- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -993,13 +993,13 @@ void HWNDMessageHandler::FrameTypeChanged() { @@ -994,13 +994,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
void HWNDMessageHandler::PaintAsActiveChanged() { void HWNDMessageHandler::PaintAsActiveChanged() {
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() || if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
@ -55,7 +55,7 @@ index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010
} }
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon, void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
@@ -1083,7 +1083,14 @@ void HWNDMessageHandler::SizeConstraintsChanged() { @@ -1084,7 +1084,14 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
// allowing ui::GetResizableFrameThickness() to be used consistently when // allowing ui::GetResizableFrameThickness() to be used consistently when
// removing the visible system frame. // removing the visible system frame.
const bool had_caption_on_init = window_style() & WS_CAPTION; const bool had_caption_on_init = window_style() & WS_CAPTION;
@ -71,7 +71,7 @@ index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010
const bool can_maximize = can_resize && delegate_->CanMaximize(); const bool can_maximize = can_resize && delegate_->CanMaximize();
auto set_style_func = [&style](LONG bit, bool should_set) { auto set_style_func = [&style](LONG bit, bool should_set) {
@@ -1678,11 +1685,16 @@ void HWNDMessageHandler::ResetWindowRegion(bool force, bool redraw) { @@ -1679,11 +1686,16 @@ void HWNDMessageHandler::ResetWindowRegion(bool force, bool redraw) {
// through, but that isn't the case when using Direct3D to draw transparent // through, but that isn't the case when using Direct3D to draw transparent
// windows. So we route translucent windows throught to the delegate to // windows. So we route translucent windows throught to the delegate to
// allow for a custom hit mask. // allow for a custom hit mask.
@ -89,7 +89,7 @@ index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010
return; return;
} }
@@ -2396,17 +2408,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, @@ -2415,17 +2427,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
delegate_->SchedulePaint(); delegate_->SchedulePaint();
} }

View file

@ -20,7 +20,7 @@ index 651cb633d791d769ae2758930e7fb6310aa3637b..5f2da839ab5ddd05d1242d07a2b24c26
} }
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 84b2ec91bc0ec42f74e91c4d4a9d71b0ffc0bcd8..ea191e8305b3945a4ca3cd555d9649b905d12e19 100644 index f9372f547ef0d5914ba53b75aba44580a573fba0..3d7b749b90d3aa59c17f4d3220805dda263b7037 100644
--- a/content/public/browser/content_browser_client.h --- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -337,6 +337,11 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -337,6 +337,11 @@ class CONTENT_EXPORT ContentBrowserClient {

View file

@ -10,10 +10,10 @@ on Windows. We should refactor our code so that this patch isn't
necessary. necessary.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index d01dd0a53bb41f0c66676ca313453d43a2aab80a..620017bbe06e504a65bcb3a778be6f440a4d8bce 100644 index d974ad3aa4bcb58a5c9bc5ed17be19820313d266..f2b99686fbb1ccd5f356b44f81d490bb67dee899 100644
--- a/testing/variations/fieldtrial_testing_config.json --- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -24851,6 +24851,21 @@ @@ -24867,6 +24867,21 @@
] ]
} }
], ],

View file

@ -15,7 +15,7 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value. `api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 861468d545856eb894b3eaae943028b954c83b82..3d6489a4abcdf7f6c26507583df446c4b293cd13 100644 index d1bfad9bfdcb44b8988a6250b71e15d191134ba8..71151ec503d38b8dbbcbc4c12530a9a88212388a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc --- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -8922,6 +8922,17 @@ void RenderFrameHostImpl::EnterFullscreen( @@ -8922,6 +8922,17 @@ void RenderFrameHostImpl::EnterFullscreen(

View file

@ -210,7 +210,6 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
HandleSIGCHLD(); HandleSIGCHLD();
#endif #endif
#if BUILDFLAG(IS_LINUX) #if BUILDFLAG(IS_LINUX)
DetectOzonePlatform();
ui::OzonePlatform::PreEarlyInitialization(); ui::OzonePlatform::PreEarlyInitialization();
#endif #endif
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)

View file

@ -124,10 +124,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
#endif #endif
#if BUILDFLAG(IS_LINUX)
void DetectOzonePlatform();
#endif
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
void FreeAppDelegate(); void FreeAppDelegate();
void RegisterURLHandler(); void RegisterURLHandler();

View file

@ -1,135 +0,0 @@
// Copyright (c) 2022 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/electron_browser_main_parts.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/strings/cstring_view.h"
#include "ui/base/ozone_buildflags.h"
#include "ui/ozone/public/ozone_switches.h"
#if BUILDFLAG(IS_OZONE_WAYLAND)
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/nix/xdg_util.h"
#include "shell/common/thread_restrictions.h"
#endif
namespace electron {
namespace {
constexpr base::cstring_view kElectronOzonePlatformHint{
"ELECTRON_OZONE_PLATFORM_HINT"};
#if BUILDFLAG(IS_OZONE_WAYLAND)
constexpr char kPlatformWayland[] = "wayland";
bool HasWaylandDisplay(base::Environment* env) {
if (std::optional<std::string> wayland_display =
env->GetVar("WAYLAND_DISPLAY")) {
return true;
}
if (std::optional<std::string> xdg_runtime_dir =
env->GetVar("XDG_RUNTIME_DIR")) {
auto wayland_server_pipe =
base::FilePath(*xdg_runtime_dir).Append("wayland-0");
// Normally, this should happen exactly once, at the startup of the main
// process.
electron::ScopedAllowBlockingForElectron allow_blocking;
return base::PathExists(wayland_server_pipe);
}
return false;
}
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
#if BUILDFLAG(IS_OZONE_X11)
constexpr char kPlatformX11[] = "x11";
#endif
// Evaluates the environment and returns the effective platform name for the
// given |ozone_platform_hint|.
// For the "auto" value, returns "wayland" if the XDG session type is "wayland",
// "x11" otherwise.
// For the "wayland" value, checks if the Wayland server is available, and
// returns "x11" if it is not.
// See https://crbug.com/1246928.
std::string MaybeFixPlatformName(const std::string& ozone_platform_hint) {
#if BUILDFLAG(IS_OZONE_WAYLAND)
// Wayland is selected if both conditions below are true:
// 1. The user selected either 'wayland' or 'auto'.
// 2. The XDG session type is 'wayland', OR the user has selected 'wayland'
// explicitly and a Wayland server is running.
// Otherwise, fall back to X11.
if (ozone_platform_hint == kPlatformWayland ||
ozone_platform_hint == "auto") {
auto env(base::Environment::Create());
std::optional<std::string> xdg_session_type =
env->GetVar(base::nix::kXdgSessionTypeEnvVar);
if ((xdg_session_type.has_value() && *xdg_session_type == "wayland") ||
(ozone_platform_hint == kPlatformWayland &&
HasWaylandDisplay(env.get()))) {
return kPlatformWayland;
}
}
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
#if BUILDFLAG(IS_OZONE_X11)
if (ozone_platform_hint == kPlatformX11) {
return kPlatformX11;
}
#if BUILDFLAG(IS_OZONE_WAYLAND)
if (ozone_platform_hint == kPlatformWayland ||
ozone_platform_hint == "auto") {
// We are here if:
// - The binary has both X11 and Wayland backends.
// - The user wanted Wayland but that did not work, otherwise it would have
// been returned above.
if (ozone_platform_hint == kPlatformWayland) {
LOG(WARNING) << "No Wayland server is available. Falling back to X11.";
} else {
LOG(WARNING) << "This is not a Wayland session. Falling back to X11. "
"If you need to run Chrome on Wayland using some "
"embedded compositor, e. g., Weston, please specify "
"Wayland as your preferred Ozone platform, or use "
"--ozone-platform=wayland.";
}
return kPlatformX11;
}
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
return ozone_platform_hint;
}
} // namespace
void ElectronBrowserMainParts::DetectOzonePlatform() {
auto const env = base::Environment::Create();
auto* const command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kOzonePlatform)) {
auto ozone_platform_hint =
command_line->GetSwitchValueASCII(switches::kOzonePlatformHint);
if (ozone_platform_hint.empty()) {
ozone_platform_hint =
env->GetVar(kElectronOzonePlatformHint).value_or("");
}
if (!ozone_platform_hint.empty()) {
command_line->AppendSwitchASCII(
switches::kOzonePlatform, MaybeFixPlatformName(ozone_platform_hint));
}
}
if (std::optional<std::string> desktop_startup_id =
env->GetVar("DESKTOP_STARTUP_ID"))
command_line->AppendSwitchASCII("desktop-startup-id", *desktop_startup_id);
}
} // namespace electron