Commit graph

3332 commits

Author SHA1 Message Date
Charles Kerr
98380468bb
fix: Linux visibleOnAllWorkspaces property (#46850)
* test: do not skip visibleOnAllWorkspaces tests on Windows

That feature is supported on Linux, so move the test from the
"window states (excluding Linux)" section into the
"window states" section.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: disable visibleOnAllWorkspaces test on Linux

* fix: NativeWindowViews::IsVisibleOnAllWorkspaces

* test: enable visibleOnAllWorkspaces tests on Linux

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2025-04-29 13:08:53 -05:00
trop[bot]
dcd8224c15
fix: fullscreen fillet / recovery is incorrect (#46848)
* fix: fullscreen fillet / recovery is incorrect

Signed-off-by: ZOY\zoy-l <zoy-l@outlook.com>

Co-authored-by: ZOY\zoy-l <zoy-l@outlook.com>

* fix: maintain frameless consistency on windows 11

Co-authored-by: ZOY\zoy-l <zoy-l@outlook.com>

* fix: maintain frameless consistency on windows 11

Co-authored-by: ZOY\zoy-l <zoy-l@outlook.com>

* chore: modify the comments

Co-authored-by: ZOY\zoy-l <zoy-l@outlook.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: ZOY\zoy-l <zoy-l@outlook.com>
2025-04-28 22:07:32 -05:00
trop[bot]
6bb07bf277
fix: build error with enable_electron_extensions=false (#46842)
Fix build error with enable_electron_extensions=false

In file included from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h:13,
                 from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:50,
                 from ../../base/memory/raw_ptr.h:11,
                 from ../../base/memory/weak_ptr.h:82,
                 from ../../electron/shell/browser/usb/electron_usb_delegate.h:14,
                 from ../../electron/shell/browser/usb/electron_usb_delegate.cc:5:
../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:279:3: warning: multi-line comment [-Wcomment]
  279 |   //       \
      |   ^
../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:281:3: warning: multi-line comment [-Wcomment]
  281 |   //         \
      |   ^
In file included from /usr/include/c++/14/memory:78,
                 from ../../electron/shell/browser/usb/electron_usb_delegate.h:8:
/usr/include/c++/14/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = device::mojom::UsbDeviceInfo]’:
/usr/include/c++/14/bits/unique_ptr.h:399:17:   required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = device::mojom::UsbDeviceInfo; _Dp = std::default_delete<device::mojom::UsbDeviceInfo>]’
  399 |           get_deleter()(std::move(__ptr));
      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
../../mojo/public/cpp/bindings/struct_ptr.h:48:3:   required from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = mojo::StructPtr<device::mojom::UsbDeviceInfo>]’
   48 |   ~StructPtr() = default;
      |   ^
/usr/include/c++/14/bits/stl_construct.h:149:22:   required from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = mojo::StructPtr<device::mojom::UsbDeviceInfo>]’
  149 |       std::destroy_at(__pointer);
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_construct.h:163:19:   required from ‘static constexpr void std::_Destroy_aux<<anonymous> >::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr<device::mojom::UsbDeviceInfo>*; bool <anonymous> = false]’
  163 |             std::_Destroy(std::__addressof(*__first));
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_construct.h:193:44:   required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr<device::mojom::UsbDeviceInfo>*]’
  193 |         return std::_Destroy_aux<false>::__destroy(__first, __last);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/alloc_traits.h:981:20:   required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = mojo::StructPtr<device::mojom::UsbDeviceInfo>*; _Tp = mojo::StructPtr<device::mojom::UsbDeviceInfo>]’
  981 |       std::_Destroy(__first, __last);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:735:15:   required from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = mojo::StructPtr<device::mojom::UsbDeviceInfo>; _Alloc = std::allocator<mojo::StructPtr<device::mojom::UsbDeviceInfo> >]’
  735 |         std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
      |         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  736 |                       _M_get_Tp_allocator());
      |                       ~~~~~~~~~~~~~~~~~~~~~~
../../electron/shell/browser/usb/electron_usb_delegate.cc:231:74:   required from here
  231 |     std::move(callback).Run(std::vector<device::mojom::UsbDeviceInfoPtr>());
      |                                                                          ^
/usr/include/c++/14/bits/unique_ptr.h:91:23: error: invalid application of ‘sizeof’ to incomplete type ‘device::mojom::UsbDeviceInfo’
   91 |         static_assert(sizeof(_Tp)>0,
      |                       ^~~~~~~~~~~

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Bruno Pitrus <brunopitrus@hotmail.com>
2025-04-28 13:21:03 -05:00
trop[bot]
34adb976b6
refactor: use upstream content protection logic on macOS (#46813)
* refactor: use upstream content protection logic on macOS

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update shell/browser/native_window.h

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-27 15:49:52 -05:00
trop[bot]
3981c173ef
refactor: remove public method BrowserWindow::GetWeakPtr() (#46796)
refactor: remove public method electron::api::BrowserWindow::GetWeakPtr()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-25 20:09:44 -05:00
trop[bot]
d52670c749
refactor: use std::map::try_emplace() over std::map::insert() (#46794)
refactor: prefer std::map::try_emplace() over std::map::insert()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-25 15:22:00 -05:00
trop[bot]
5dab95335b
fix: bluetooth crash in select-bluetooth-device event (#46782)
fix: bluetooth crash on bluetooth off

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-25 13:28:28 -05:00
trop[bot]
c4302ab58c
fix: crash when renderer process crashes while webview is reloading (#46768)
WebView uses WebContentsViewChildFrame, which doesn't have a Focus impl
and triggers a fatal NOTREACHED.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jinli Wu <wujinli@bytedance.com>
2025-04-25 18:01:41 +02:00
trop[bot]
02e4e109d5
fix: vibrancy window border (#46771)
fix: vibrancy window border (#46648)

* fix: vibrancy window border

* Use WidgetDelegate::OnWidgetInitialized instead

Co-authored-by: Calvin <clavin@users.noreply.github.com>
2025-04-25 11:31:12 -04:00
trop[bot]
08a4c333a3
fix: missing HandleScope in RemoveFromParentChildWindows (#46773)
fix: missing HandleScope in RemoveFromParentChildWindows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-25 11:30:19 -04:00
trop[bot]
5a4ef1cc33
refactor: make node Buffers more friendly to base::span / std::span (#46778)
* refactor: add electron::Buffer namespace; move the Buffer as_byte_span() into it

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* feat: add electron::Buffer::Copy()

a span-friendly version of node::Buffer::Copy()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_base_window.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_data_pipe_holder.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_safe_storage.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_clipboard.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in osr_converter.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_native_image.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in net_converter.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use electron::Buffer::Copy() in electron_api_web_contents.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make NewEmptyBuffer() return a Local<Value>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-25 10:24:43 -05:00
trop[bot]
fc319e0ea3
fix: explicitly call GetNativeNSView() on macOS (#46750)
* fix: explicitly call GetNativeNSView() on macOS

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: move macOS impl to a .mm file

This is needed in order to access gfx::NativeView::GetNativeNSView()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-24 09:53:53 -05:00
trop[bot]
07a7ebb714
refactor: make electron::api::BaseWindow fields private (#46710)
refactor: make electron::api::BaseWindow fields private

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-22 12:33:01 -05:00
trop[bot]
b0d4c12247
fix: osr stutter fix backport for electron. (#46709)
* fix: osr stutter fix backport for electron.

* nit: chromium upstream patch link

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: reito <cnschwarzer@qq.com>
2025-04-22 11:40:35 -05:00
trop[bot]
8f40f8126e
fix: file dialog filters not working correctly (#46722)
fix: fix file dialog filters not working correctly

If someone sets an `All filter` with `*` at the start of the filters all upcoming filters will be shifted and thus labels won't fit to the extensions they actually filter.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kolja Lampe <razzeee@gmail.com>
2025-04-22 11:32:15 -05:00
trop[bot]
3348ac08b4
perf: avoid triple map lookup in ElectronHidDelegate::GetContextObserver() (#46687)
perf: avoid triple map lookup in ElectronHidDelegate::GetContextObserver()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-19 17:51:27 -05:00
trop[bot]
2960f93ea5
refactor: remove WebContentsPermissionHelper::PermissionTypes::KEYBOARD_LOCK (#46677)
refactor: remove electron::WebContentsPermissionHelper::PermissionTypes::KEYBOARD_LOCK

This was added in 344aba0. In the time when this PR initially went up and
when 344aba0 landed, upstream added blink::PermissionTypes::KEYBOARD_LOCK.
Our duplicate copy can be removed.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-18 19:09:54 -05:00
trop[bot]
301f7b4e64
fix: postMessage crash with invalid transferrable (#46667)
* fix: postMessage crash with invalid transferrable

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: address review feedback

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-17 18:23:23 +02:00
trop[bot]
7b66361ca8
feat: expose nativeTheme.shouldUseDarkColorsForSystemIntegratedUI (#46598)
feat: expose shouldUseDarkColorsForSystemIntegratedUI

Closes https://github.com/electron/electron/issues/46429.
Refs https://github.com/electron/electron/pull/19735.

This PR adds a new API `shouldUseDarkColorsForSystemIntegratedUI` to the
`nativeTheme` module. This API returns a boolean indicating whether the
system is using dark colors for system integrated UI elements. This is
useful for applications that want to adapt their UI to match the system
theme, especially for those that use system integrated UI elements like
the shell theme or taskbar appearance.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-16 19:40:55 +02:00
trop[bot]
f8a55100cc
refactor: migrate to non-deprecated allowedContentTypes on macOS (#46646)
refactor: migrated to non-deprecated allowedContentTypes on macOS

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-15 17:01:53 -04:00
trop[bot]
c785b40703
fix: window border on Gnome Wayland (#46642)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-15 20:33:23 +02:00
trop[bot]
339e0040ef
fix: paint and flash issues on macOS (#46629) 2025-04-15 12:56:20 +02:00
trop[bot]
53633fcaeb
fix: fallback to old MacOS context menu behavior if no frame is present (#46619)
* fix: fallback to old MacOS context menu behavior if no frame is present

Co-authored-by: georgexu99 <georgexu99@electronjs.org>
Co-authored-by: erickzhao <erickzhao@electronjs.org>
Co-authored-by: clavin <calvin@electronjs.org>

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* docs: add additional option for focusedFrame

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fix: handle frame found, but no view update from rfh

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fix: fix conditional

Co-authored-by: Calvin <clavin@users.noreply.github.com>

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2025-04-14 11:24:01 +02:00
trop[bot]
285d347b51
refactor: use default printing path when no user options (#46617)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-12 18:50:06 -05:00
trop[bot]
b518e4ad36
fix: re-enable OOP printing on Linux (#46585)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-11 14:25:15 -04:00
trop[bot]
70fd706ea4
fix: NativeWindow.window_id() returns same value for all windows (#46590)
fix: NativeWindow.window_id() returns same value for all windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-10 11:28:58 +02:00
trop[bot]
28eb0e6f3d
fix: crash on parent window close and focur/blur (#46580)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-09 11:19:20 -05:00
trop[bot]
b234733555
refactor: remove unnecessary const_cast (#46567)
refactor: remove unnecessary const_cast

unnecessary since July 2019 in 50b9c70

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-08 17:12:51 -05:00
trop[bot]
3fdcd38b8b
refactor: simplify some BaseWindow JS getters (#46565)
* refactor: return a std::array<int 2> from BaseWindow::GetMaximumSize()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: return a std::array<int 2> from BaseWindow::GetMinimumSize()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: return a std::array<int 2> from BaseWindow::GetPosition()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: return a std::array<int 2> from BaseWindow::GetSize()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: return a std::array<int 2> from BaseWindow::GetContentSize()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: extract helper method ToArray(const gfx::Size)

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: #include correctness

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-08 13:44:15 -05:00
trop[bot]
feaa9ec5b9
refactor: make api::View methods const, private (#46551)
* refactor: make api::View::GetBounds() const

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make api::View::OnViewBoundsChanged() private

refactor: make api::View::OnViewIsDeleting() private

refactor: make api::View::OnChildViewRemoved() private

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make ChildPair private

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-08 08:53:17 -05:00
trop[bot]
1046842f73
refactor: migrate to View::AddChildView(std::unique_ptr<ui::View*>) (#46541)
* refactor: use AddChildView(std::unique_ptr<View>) in OpaqueFrameView::CreateButton()

Xref: https://issues.chromium.org/issues/40485510

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use AddChildView(std::unique_ptr<View>) in MenuBar::RebuildChildren()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux labels

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux buttons

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use AddChildView(std::unique_ptr<View>) in AutofillPopupView

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use AddChildViewRaw() to flag the edge cases that we still need to fix

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: use west coast const for consistency

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-07 13:29:37 -05:00
electron-roller[bot]
2dd4b77ae0
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184)
* chore: bump chromium in DEPS to 136.0.7081.1

* chore: bump chromium in DEPS to 136.0.7083.1

* chore: bump chromium in DEPS to 136.0.7085.1

* chore: bump chromium in DEPS to 136.0.7087.1

* chore: bump chromium in DEPS to 136.0.7089.0

* chore: bump chromium in DEPS to 136.0.7091.0

* chore: bump chromium in DEPS to 136.0.7092.0

* chore: bump chromium in DEPS to 136.0.7093.1

* chore: bump chromium in DEPS to 136.0.7095.1

* chore: bump chromium in DEPS to 136.0.7097.1

* chore: bump chromium in DEPS to 136.0.7099.1

* chore: bump chromium in DEPS to 136.0.7101.0

* chore: bump chromium in DEPS to 136.0.7103.0

* chore: bump chromium in DEPS to 136.0.7103.15

* chore: bump chromium in DEPS to 136.0.7103.17

* chore: bump chromium to 136.0.7095.0 (main) (#46118)

* chore: bump chromium in DEPS to 136.0.7076.0

* chore: bump chromium in DEPS to 136.0.7077.0

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6356528: Clean up LegacyRenderWidgetHostHWND code | 6356528

* chore: export patches

* 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | 6339113

* 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | 6352169

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| 6360858

* chore: bump chromium in DEPS to 136.0.7079.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7081.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7083.0

* 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | 6361987

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7087.0

* chore: export patches

* fix: include node patch for missing AtomicsWaitEvent
6385540

* build: add depot_tools python to path

* fix: cppgc init and unregistering v8 isolate

6333562

CppGc is now initialized earlier so Node can skip reinitializing it.

Additionally, gin::IsolateHandle was attempting to destruct an already destructed
v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call
to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown.

* fix: unregister isolate after destruction

See code comment.

* chore: bump chromium in DEPS to 136.0.7095.0

* chore: sync patches

* fix: add script_parsing::ContentScriptType parameter
6298395

* fix: migrate content::BrowserAccessibilityState methods
6401437
6383275

* feat: enableHappyEyeballs option for host resolver
6332599

* fix: add new cookie exclusion reason
6343479

* fix: add new url loader method
6337340

* fix: add new cppgc header file for electron_node headers
6348644

* fix: disable CREL on Linux ARM64
https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9

* fixup! fix: add new cppgc header file for electron_node headers 6348644

* chore: update corner smoothing patch

* fixup! chore: update corner smoothing patch

* chore: disable NAN weak tests

These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback.

Ref: 4733273

* test: fix task starvation in node test

A V8 change makes these contexts get collected in a task that is posted
and run asynchronously. The tests were synchronously GC'ing in an
infinite loop, preventing the task loop from running the task that would
GC these contexts.

This change should be upstreamed in some way.

Ref: 4733273

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
(cherry picked from commit 9c019b6147)

* Remove file-wide unsafe buffer suppression from content/ [3 of N]

6341711

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
trop[bot]
5942ac580b
revert: allow NSMenuItems to be disabled (#46523)
Revert "fix: allow NSMenuItems to be disabled (#46307)"

This reverts commit ac616ef41d.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Hailey <hschauman@slack-corp.com>
2025-04-07 10:42:11 -05:00
trop[bot]
ec34d8ee49
perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal() (#46527)
perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal()

Why waste time make lot call when few call do trick?

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-07 10:40:10 -05:00
trop[bot]
64c9afcf77
refactor: use base::flat_set in WebContents::DidUpdateFaviconUrl() (#46530)
* refactor: add gin::Converter<std::span>::ToV8()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* feat: add ToV8(const base::flat_set<T>&)

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use a flat_set in WebContents::TitleWasSet()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: add gin::Converter<std::array>::ToV8()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-07 10:16:56 -05:00
trop[bot]
31e3c84843
refactor: instantiate navigation_entries local variable on the stack (#46504)
* refactor: instantiate navigation_entries on the stack instead of the heap

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: reserve the full size of navigation_entries

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use emplace_back to simplify the code a little

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-05 10:45:02 -05:00
trop[bot]
42514326ca
refactor: remove unused electron::api::App::FileIconCallback (#46510)
refactor: remove electron::api::App::FileIconCallback

last use removed in 2018 by 3f15f516

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-05 10:44:18 -05:00
trop[bot]
5a6ed32592
perf: prefer absl::flat_hash_set over std::set when sorted order is not needed (#46440)
* perf: use an absl::flat_hash_set for UsbChooserContext::ephemeral_devices_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use an absl::flat_hash_set for GlobalMenuBarRegistrarX11::live_windows_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use an absl::flat_hash_set for NativeWindowViews::forwarding_windows_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::guest_host_views_

perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::proxy_views_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use an absl::flat_hash_set for NativeWindow::injected_frames_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use an absl::flat_hash_set for NativeWindow::background_throttling_sources_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-03 22:21:48 -05:00
trop[bot]
99c3728a93
perf: avoid redundant call to virtual methods GetProcess() and GetID() (#46445)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-03 20:35:12 -05:00
trop[bot]
e0a24f08a1
perf: avoid redundant map lookup in HidChooserContext::DeviceChanged() (#46479)
perf: avoid redundant map lookup in HidChooserContext::DeviceChanged()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-03 20:30:41 -05:00
trop[bot]
0cb42911ea
fix: NativeWindowViews::GetRestoredState() can return wrong state when maximized (#46463)
fix: NativeWindowViews::GetRestoredState() returning wrong state

Introduced by the af58931 Chromium 131.0.6744.0 roll, specifically
9840662 (diff-f9d7ef7)

98406626

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-03 19:23:54 -05:00
trop[bot]
8fec7adfa6
fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8 (#46471)
* fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8

Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>

* fix: use CleanedUpAtExit to control the lifetime of GPUInfoManager

Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>
2025-04-03 18:05:13 -05:00
trop[bot]
30ccda8ba0
fix: ensure maximize is emitted when reduce motion is enabled on macOS (#46466)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2025-04-03 11:26:32 -07:00
trop[bot]
3acd5774da
feat: support system-context-menu on Linux (#46399)
feat: support system-context-menu on Linux

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-02 14:45:28 -04:00
trop[bot]
a0ac690881
perf: cache the return value of IsX11() (#46427)
* perf: cache the return value of IsX11()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fix: mark as nodiscard for those who call, but mark as maybe_unused for Windows

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 21:58:08 -05:00
trop[bot]
7299dd1501
perf: avoid redundant map lookup in UsbChooserContext::OnDeviceRemoved() (#46418)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 20:53:43 -05:00
trop[bot]
58b2c2e651
fix: leaked gfx::Canvas in AutofillPopupView::OnPaint() (#46412)
* perf: avoid redundant call to popup_bounds_in_view()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use a std::optional<> for paint_canvas local

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fix: fix leaked gfx::Canvas in AutofillPopupView::OnPaint()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove redundant get() call when testing smart pointer for nonempty

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove unnecessary draw_canvas variable

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename bitmap to offscreen_bitmap for symmetry

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: avoid another redundant call to popup_bounds_in_view()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 16:58:33 -05:00
trop[bot]
4db5a2a2b2
fix: rounded corners disappear momentarily on window close (#46407)
fix: Explicitly set rounded corners in borderless mode on Windows 11

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: zoy <zoy-l@outlook.com>
2025-04-01 13:28:58 -05:00
trop[bot]
6126cc2bfe
fix: UtilityProcess.fork crash before app ready (#46404)
fix: UtilityProcess.fork crash before app ready

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-01 09:32:43 -05:00
trop[bot]
33eff16e9a
perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46396)
* perf: avoid making an unnecessary copy of the vector

MimeTypesHandler::GetMIMETypeAllowlist() returns a const&, so we can
iterate that directly instead of making a temporary copy of it.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: move the call to ExtensionRegistry::Get() outside of the loop

Also, keep the previous behavior of not calling it at all if there
aren't any whitelisted extensions.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: avoid redundant map lookup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: const correctness

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: cleanup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 09:01:48 -05:00