diff --git a/DEPS b/DEPS index cd9ac4312245..d075ae467e72 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '140.0.7339.2', + '140.0.7339.16', 'node_version': 'v22.18.0', 'nan_version': diff --git a/docs/api/environment-variables.md b/docs/api/environment-variables.md index cbd3525d03e1..f6b05c4cf85c 100644 --- a/docs/api/environment-variables.md +++ b/docs/api/environment-variables.md @@ -125,16 +125,6 @@ Options: * `kioclient5` * `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 The following environment variables are intended primarily for development and diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index b61f2d9576b6..05e8bec2f144 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -14,14 +14,12 @@ This document uses the following convention to categorize breaking changes: ## 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). 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 macOS 11 (Big Sur) is no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/6594615). diff --git a/filenames.gni b/filenames.gni index 60b06800b24d..488058008c20 100644 --- a/filenames.gni +++ b/filenames.gni @@ -23,7 +23,6 @@ filenames = { lib_sources_linux = [ "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.h", "shell/browser/linux/unity_service.cc", diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index 080b9e3c8ddc..a5fc56577f7f 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -33,10 +33,10 @@ index e648bb4ed2ff72441faa8773e449e0b6174f5af5..fd2c1d3ac575d10de7d5c09e4418d172 "//base", "//build:branding_buildflags", 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 +++ 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. deps += [ "//chrome:packed_resources_integrity_header" ] 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 +++ b/chrome/test/BUILD.gn @@ -7455,9 +7455,12 @@ test("unit_tests") { diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index ea6127817c87..835294ca891e 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,7 +9,7 @@ potentially prevent a window from being created. 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 -index 04ab9256afe51df82b2c5a34334a7e98f49bc82a..861468d545856eb894b3eaae943028b954c83b82 100644 +index 0a02467f8dff5278b5cc530f6d08b2402b52098d..d1bfad9bfdcb44b8988a6250b71e15d191134ba8 100644 --- a/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( @@ -77,10 +77,10 @@ index fc433c5802ecb880f3f144f09c3d318814672213..6a1e1f2cfc60451bb097b3625245fbfb // 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 -index 5fb9980e5f7672a9b518776bcfc9e54726d24a62..707b3ca716d5654ddfcf40f43582524e0c2b6492 100644 +index 689203b138adf10a27c47dea61d3fe352df80b1e..2988ef70882ed30105d888491feb88db429c85ca 100644 --- a/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, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -90,7 +90,7 @@ index 5fb9980e5f7672a9b518776bcfc9e54726d24a62..707b3ca716d5654ddfcf40f43582524e bool opener_suppressed, bool* no_javascript_access) { 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 +++ b/content/public/browser/content_browser_client.h @@ -199,6 +199,7 @@ class NetworkService; @@ -101,7 +101,7 @@ index 7e953576d8be22f2efa49ee8eb349ddab63fd276..84b2ec91bc0ec42f74e91c4d4a9d71b0 } // namespace network namespace sandbox { -@@ -1428,6 +1429,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1435,6 +1436,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, diff --git a/patches/chromium/chore_modify_chromium_handling_of_mouse_events.patch b/patches/chromium/chore_modify_chromium_handling_of_mouse_events.patch index bd3ba58cd096..72de41822a23 100644 --- a/patches/chromium/chore_modify_chromium_handling_of_mouse_events.patch +++ b/patches/chromium/chore_modify_chromium_handling_of_mouse_events.patch @@ -61,10 +61,10 @@ index dcda976f4c3cc0ba6bcf015d5bf7435df009ae30..13cfa18bf406f244ec361a1230ccce44 Widget* GetWidget(); const Widget* GetWidget() const; 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 +++ 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 // they won't work. @@ -86,7 +86,7 @@ index eb1bc6840fcf026ed2ab902bae534607af84abee..88a4eeea8ff5226600c804c6df5832f9 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. is_right_mouse_pressed_on_caption_ = false; ReleaseCapture(); @@ -94,7 +94,7 @@ index eb1bc6840fcf026ed2ab902bae534607af84abee..88a4eeea8ff5226600c804c6df5832f9 // |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu() // expect screen coordinates. 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(SendMessage( hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y))); if (w_param == HTCAPTION || w_param == HTSYSMENU) { diff --git a/patches/chromium/chore_patch_out_profile_methods.patch b/patches/chromium/chore_patch_out_profile_methods.patch index 1a9b19fe303f..8e5c6d04ecf3 100644 --- a/patches/chromium/chore_patch_out_profile_methods.patch +++ b/patches/chromium/chore_patch_out_profile_methods.patch @@ -7,7 +7,7 @@ Electron does not support Profiles, so we need to patch it out of any code that we use. 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 +++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc @@ -45,6 +45,7 @@ namespace { diff --git a/patches/chromium/custom_protocols_plzserviceworker.patch b/patches/chromium/custom_protocols_plzserviceworker.patch index a921e308d4f0..cf915acdfbaf 100644 --- a/patches/chromium/custom_protocols_plzserviceworker.patch +++ b/patches/chromium/custom_protocols_plzserviceworker.patch @@ -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 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 +++ 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 = context()->loader_factory_bundle_for_update_check()->Clone(); @@ -38,7 +38,7 @@ index 3202822020573106b0ee2305f08971b3b542be69..9a033cb1f48288802fb349e885a15295 if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig( browser_context(), scope)) { // 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) && scope.scheme_piece() == kChromeUIScheme) { config->RegisterURLDataSource(browser_context()); @@ -49,7 +49,7 @@ index 3202822020573106b0ee2305f08971b3b542be69..9a033cb1f48288802fb349e885a15295 .emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory( browser_context(), kChromeUIScheme, base::flat_set())); -@@ -1970,9 +1988,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( +@@ -1976,9 +1994,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( features::kEnableServiceWorkersForChromeUntrusted) && scope.scheme_piece() == kChromeUIUntrustedScheme) { config->RegisterURLDataSource(browser_context()); diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index 4988c4752fb7..76c5a1ddf8e1 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,10 +19,10 @@ index 671960fb876b656abc572664cd1f28492c799123..896721c02c1cf0dac03d98b152af210e excluded_margin); } 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 +++ 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, const gfx::Size& excluded_margin) { diff --git a/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch b/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch index fa42771e0954..661add0b1165 100644 --- a/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch +++ b/patches/chromium/feat_corner_smoothing_css_rule_and_blink_painting.patch @@ -312,7 +312,7 @@ index 7e3d46902fbf736b4240eb3fcb89975a7b222197..57fdc89fc265ad70cb0bff8443cc1026 auto DrawAsSinglePath = [&]() { 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 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 @@ -214,6 +214,10 @@ diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index 2852ed58dd39..3a64048c8e9d 100644 --- a/patches/chromium/fix_aspect_ratio_with_max_size.patch +++ b/patches/chromium/fix_aspect_ratio_with_max_size.patch @@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the BrowserWindow. 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 +++ 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); min_window_size = delegate_->DIPToScreenSize(min_window_size); max_window_size = delegate_->DIPToScreenSize(max_window_size); diff --git a/patches/chromium/fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch b/patches/chromium/fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch index 4da3fa160628..1fa8621a09e8 100644 --- a/patches/chromium/fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch +++ b/patches/chromium/fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch @@ -13,10 +13,10 @@ messages in the legacy window handle layer. 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 -index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd00c817e37 100644 +index 475629d48e8807547e0c79f6fa00d458bac3416c..97f4520fbf7797b19747b5101097d93cf475fb5c 100644 --- a/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, LPARAM l_param, BOOL& handled) { @@ -31,7 +31,7 @@ index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd0 tme.hwndTrack = hwnd(); tme.dwHoverTime = 0; TrackMouseEvent(&tme); -@@ -404,7 +404,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message, +@@ -413,7 +413,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message, // the picture. if (!handled && (message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) { @@ -44,7 +44,7 @@ index 156fa90eada19fab3a1688302bbf3687cab6ab32..b13d4fcea374eff4309b4fbe84d53dd0 } 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 -index 17952b4b6ab559ba1c9076b100b060a7011edeec..1eda20e67d3b3184bec154f24c4259bb4a49b099 100644 +index f9699ff0abf9036e9e1cabf626aa6395584cf896..94a8a50cb630182103c4256352d7a8a2acc8c76a 100644 --- a/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 diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index f8d4416e2404..610abd8000b5 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -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. 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 +++ 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), 0); diff --git a/patches/chromium/fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch b/patches/chromium/fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch index d24eac2f4cb4..1d8c0cc802fc 100644 --- a/patches/chromium/fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch +++ b/patches/chromium/fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch @@ -36,10 +36,10 @@ index d8be4dffee3947e7ac6dc09cb8e1f2a6a834789b..8eb539af74c1934a55f9b14ad97dd93b // Overridden from DesktopWindowTreeHost: 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 -index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010b9ca95df 100644 +index 1287e9eda295061a7ee9b758b3c0618933896d82..e2b899dd25c12448068c99f1344cba4fea26e2c6 100644 --- a/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() { if (!delegate_->HasNonClientView() || !delegate_->CanActivate() || @@ -55,7 +55,7 @@ index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010 } 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 // removing the visible system frame. 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(); 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 // windows. So we route translucent windows throught to the delegate to // allow for a custom hit mask. @@ -89,7 +89,7 @@ index 45b9be8cef981c570f7975f4bbd1d6d2fcc39afb..d73e822bfe9a86869cf5b8d1f63d6010 return; } -@@ -2396,17 +2408,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, +@@ -2415,17 +2427,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, delegate_->SchedulePaint(); } diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 8040a39a97b5..7750a1da7959 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -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 -index 84b2ec91bc0ec42f74e91c4d4a9d71b0ffc0bcd8..ea191e8305b3945a4ca3cd555d9649b905d12e19 100644 +index f9372f547ef0d5914ba53b75aba44580a573fba0..3d7b749b90d3aa59c17f4d3220805dda263b7037 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -337,6 +337,11 @@ class CONTENT_EXPORT ContentBrowserClient { diff --git a/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch b/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch index d15522a940a0..4f6e5b7de6fc 100644 --- a/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch +++ b/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch @@ -10,10 +10,10 @@ on Windows. We should refactor our code so that this patch isn't necessary. 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 +++ b/testing/variations/fieldtrial_testing_config.json -@@ -24851,6 +24851,21 @@ +@@ -24867,6 +24867,21 @@ ] } ], diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 855c67e37c0f..f95b190c0b6b 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -15,7 +15,7 @@ Note that we also need to manually update embedder's `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 -index 861468d545856eb894b3eaae943028b954c83b82..3d6489a4abcdf7f6c26507583df446c4b293cd13 100644 +index d1bfad9bfdcb44b8988a6250b71e15d191134ba8..71151ec503d38b8dbbcbc4c12530a9a88212388a 100644 --- a/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( diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index aaa45b082659..bb1cc5bd295a 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -210,7 +210,6 @@ int ElectronBrowserMainParts::PreEarlyInitialization() { HandleSIGCHLD(); #endif #if BUILDFLAG(IS_LINUX) - DetectOzonePlatform(); ui::OzonePlatform::PreEarlyInitialization(); #endif #if BUILDFLAG(IS_MAC) diff --git a/shell/browser/electron_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h index ebf3e10ff1d3..86897fc9c780 100644 --- a/shell/browser/electron_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -124,10 +124,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts { const scoped_refptr& task_runner); #endif -#if BUILDFLAG(IS_LINUX) - void DetectOzonePlatform(); -#endif - #if BUILDFLAG(IS_MAC) void FreeAppDelegate(); void RegisterURLHandler(); diff --git a/shell/browser/electron_browser_main_parts_linux.cc b/shell/browser/electron_browser_main_parts_linux.cc deleted file mode 100644 index 87e2f50d2a2e..000000000000 --- a/shell/browser/electron_browser_main_parts_linux.cc +++ /dev/null @@ -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 wayland_display = - env->GetVar("WAYLAND_DISPLAY")) { - return true; - } - - if (std::optional 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 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 desktop_startup_id = - env->GetVar("DESKTOP_STARTUP_ID")) - command_line->AppendSwitchASCII("desktop-startup-id", *desktop_startup_id); -} - -} // namespace electron