Commit graph

3360 commits

Author SHA1 Message Date
trop[bot]
6dea52b6c0
refactor: make NativeWindow::pending_transitions_ a base::queue (#47182)
refactor: make NativeWindow::pending_transitions a base::queue

Follow the base/containers/README.md advice that "Chromium code should
always use `base::circular_deque` or `base::queue` in preference to
`std::deque` or `std::queue` due to memory usage and platform variation."

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-21 10:27:11 +02:00
trop[bot]
cadaaaf714
refactor: make NativeWindow::has_client_frame_ const (#47179)
* refactor: make NativeWindow::has_client_frame_ const

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

* refactor: make NativeWindow::has_client_frame_ const but not constexpr

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-05-20 21:02:35 -05:00
trop[bot]
0bd0c54cea
refactor: NativeWindows should prefer widget() over GetWidget() for internal use (#47153)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-19 17:22:55 -05:00
trop[bot]
8f908ffce2
perf: don't create unused menuitem icons (#47128)
GTK >= 3.90.0 removed support for menuitem icons. When Electron is
built with GTK >= 3.90.0, our code builds these icons and then throws
them away unused. Instead, let's just not build them.

Our gtk_util::GdkPixbufFromSkBitmap utility uses BGRAToRGBA and is
expensive to call.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-16 11:05:26 -05:00
trop[bot]
ae232703de
refactor: make TrackableObject::weak_map_id() constexpr (#47116)
* refactor: make TrackableObject::weak_map_id() constexpr

refactor: make BaseWindow::GetID() inline and constexpr

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

* refactor: make NativeWindow::window_id() constexpr too

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-05-16 02:32:44 -05:00
trop[bot]
747b2f62e0
fix: opening package paths as directory on macOS (#47109)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-05-16 12:17:07 +09:00
trop[bot]
6eac8d8af9
refactor: decouple NativeWindowViews and GlobalMenuBarX11 (#47118)
The GlobalMenuBar used to hold a raw_ptr reference to its NativeWindow;
but since it doesn't use it & only wants the gfx::AcceleratedWidget info,
let's remove the NativeWindowViews reference.

AFAICT, GlobalMenuBarX11::window_ has never been used

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-15 19:38:56 -05:00
trop[bot]
6a0e31633a
feat: enable innerWidth and innerHeight for window open (#47038)
feat: enable innerWidth and innerHeight for window open (#46749)

* feat: enable innerWidth and innerHeight for window open

* update comment for added special innerWidth and innerHeight

* update 100 min spec requirement handling

* update testing to include getContentSize

* update macOS min requirement handling

* adjust refactored consts

* update const values from nativewindowviews

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2025-05-15 12:23:17 -07:00
trop[bot]
8b2b155c5d
feat: enable secondary label for macOS menu (#47040)
* feat: enable secondary label for macOS menu

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* Update shell/browser/ui/cocoa/electron_menu_controller.mm

Co-authored-by: Robo <hop2deep@gmail.com>

Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>

* fix for lint

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* update docs for sublabel

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2025-05-15 12:22:41 -07:00
trop[bot]
de81d8a4a6
refactor: use kKeyModifiers in IsAltModifier() (#47090)
We probably didn't use this before because IsAltModifier() was written
two years before the KeyModifiers mask was added upstream in 98ec378a.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-14 12:18:10 -05:00
trop[bot]
bc553af826
fix: white window flicker on window creation (#47053)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-11 15:00:07 -05:00
trop[bot]
7030816fe1
fix: restore previous Windows screenshotting (#47032)
Fixes https://github.com/electron/electron/issues/45990

We previously made a change in https://github.com/electron/electron/pull/45868
to fix content protection being lost on hide and re-show. However, this
cause a breaking change where protected windows were made opaque black
instead of being hidden as before. This overrides relevant methods in
ElectronDesktopWindowTreeHostWin to restore the previous behavior.
without regressing the original issue.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-09 13:10:19 -04:00
trop[bot]
07c0357366
fix: use-after-move of bus connection in xdg portal detection (#47024)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-05-09 09:28:05 -04:00
trop[bot]
be43a76440
refactor: use gin_helper::Dictionary::ValueOrDefault() (#47015)
refactor: use `gin_helper::Dictionary::ValueOrDefault()` (#46982)

* refactor: use ValueOrDefault() in electron_api_web_contents.cc

* refactor: use ValueOrDefault() in electron_api_url_loader.cc

* refactor: use ValueOrDefault() in electron_download_manager_delegate.cc

* refactor: use ValueOrDefault() in electron_touch_bar.mm

* refactor: use ValueOrDefault() in electron_url_loader_factory.cc

* refactor: use ValueOrDefault() in electron_browser_context.cc

* refactor: use ValueOrDefault() in electron_touch_bar.mm

* refactor: use ValueOrDefault() in blink_converter.cc

* feat: add ValueOrDefault() to PersistentDictionary

* empty commit

* refactor: use ValueOrDefault() in blink_converter.cc

* refactor: inline the rectangle base::Value::Dict

* refactor: remove has_scroll temporary

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-09 09:36:55 +02:00
trop[bot]
de7cf88f17
refactor: reduce use of NativeWidgetPrivate (#47005)
* refactor: do not use native_widget_private() in NativeWindowViews::SetContentProtection()

refactor: do not use native_widget_private() in NativeWindowViews::IsContentProtected()

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

* refactor: do not use native_widget_private() in NativeWindowViews::Show()

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

* chore: remove native_widget_private #include from native_window_views_win

Not needed since Feb 2025: 9199d5c6

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-05-08 15:34:05 -05:00
trop[bot]
b822478057
fix: printing when no mediaSize specified (#46972)
fix: printing when no mediaSize specified

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-07 09:36:13 +02:00
trop[bot]
366daf192a
refactor: add gin_helper::Dictionary::ValueOrDefault() (#46968)
* feat: add gin_helper::Dictionary::ValueOrDefault()

A convenience function for using a default value if the
specified key isn't present in the dictionary.

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

* refactor: use ValueOrDefault() in native_window.cc

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

* refactor: use ValueOrDefault() in native_window_mac.mm

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

* refactor: use ValueOrDefault() in native_window_views.cc

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

* refactor: use ValueOrDefault() in electron_api_native_image.cc

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-05-06 18:50:12 -05:00
trop[bot]
695448e142
refactor: pass gfx::ResizeEdge by value (#46962)
refactor: pass gfx::ResizeEdge by value

It is an enum class, so no reason to pass by reference

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-06 14:37:34 -05:00
trop[bot]
fdc322c93f
fix: crash on macOS dialog after window-all-closed (#46951)
fix: crash on dialog after window-all-closed

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-06 14:11:37 -05:00
trop[bot]
13fe994d0d
fix: allowed dialog file types with one filter (#46945)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-06 16:12:09 +02:00
trop[bot]
7240a14126
refactor: remove some NativeWindow public API (36-x-y) (#46944)
refactor: remove some `NativeWindow` public API (#46919)

* refactor: make NativeWindow::titlebar_overlay_height_ private

* refactor: make NativeWindow::set_has_frame() protected

* refactor: remove NativeWindow::background_material()

It's only used once, in NativeWindow, so use |background_material_| directly.

* refactor: remove NativeWindow::vibrancy()

It's only used once, in a NativeWindow method, so use |vibrancy_| directly.

* refactor: unfriend api::BrowserView

It was added in Oct 2022 by 23d4a25 for access to protected NativeWindow
methods add_inspectable_view() and remove_inspectable_view().

That dependency was removed in Nov 2022 by 184ac2b, so BrowserView
doesn't need access to NativeWindow's private fields & methods anymore.

* refactor: make NativeWindow::ContentBoundsToWindowBounds() protected

refactor: make NativeWindow::WindowBoundsToContentBounds() protected

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-06 07:44:48 -05:00
Charles Kerr
5223225fb5
refactor: add NativeWindow::FromWidget() helper (36-x-y) (#46932)
refactor: add `NativeWindow::FromWidget()` helper (#46917)

refactor: add NativeWindow::FromWidet() helper

refactor: make kElectronNativeWindowKey a protected field
2025-05-06 09:51:11 +02:00
Charles Kerr
c27bd7bb3c
refactor: simplify NativeWindow::FullScreenTransitionState (36-x-y) (#46933)
refactor: simplify `NativeWindow::FullScreenTransitionState` (#46918)

* refactor: make NativeWindow::fullscreen_transition_state_ private

* refactor: add NativeWindow::is_transitioning_fullscreen() helper

* refactor: remove unused NativeWindow::fullscreen_transition_state()

* refactor: replace NativeWindow::set_fullscreen_transition_state() with NativeWindow::set_is_transitioning_fullscreen()

refactor: remove unused NativeWindow::FullScreenTransitionState
2025-05-05 14:54:00 -04:00
trop[bot]
aada99e53d
refactor: devirtualize NativeWindow methods (#46930)
* refactor: devirtualize NativeWindow::SetSize()

refactor: devirtualize NativeWindow::GetSize()

refactor: devirtualize NativeWindow::SetPosition()

refactor: devirtualize NativeWindow::GetPosition()

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

* refactor: devirtualize NativeWinodw::SetMinimumSize()

refactor: devirtualize NativeWinodw::GetMinimumSize()

refactor: devirtualize NativeWinodw::SetMaximumSize()

refactor: devirtualize NativeWinodw::GetMaximumSize()

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

* refactor: devirtualize NativeWindow::SetSheetOffset()

refactor: devirtualize NativeWindow::GetSheetOffsetX()

refactor: devirtualize NativeWindow::GetSheetOffsetY()

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

* refactor: devirtualize NativeWindow::GetContentMinimumSize()

refactor: devirtualize NativeWindow::GetContentMaximumSize()

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-05-05 12:59:31 -04:00
trop[bot]
bac01a33cd
fix: xdg portal version detection for file dialogs on linux (#46923)
* chore: use dbus thread for portal version detection

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Update shell/browser/ui/file_dialog_linux_portal.cc

Co-authored-by: Robo <hop2deep@gmail.com>

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-05-05 12:50:20 +02:00
trop[bot]
17e1ff2675
refactor: use base::ObserverList::Notify() (#46897)
* refactor: use ObserverList::Notify() in shell/browser/window_list.cc

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

* refactor: use ObserverList::Notify() in shell/browser/web_contents_zoom_controller.cc

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

* refactor: use ObserverList::Notify() in shell/browser/usb/usb_chooser_context.cc

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

* refactor: use ObserverList::Notify() in shell/browser/usb/electron_usb_delegate.cc

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

* refactor: use ObserverList::Notify() in shell/browser/ui/views/menu_delegate.cc

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

* refactor: use ObserverList::Notify() in shell/browser/ui/tray_icon.cc

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

* refactor: use ObserverList::Notify() in shell/browser/ui/electron_menu_model.cc

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

* refactor: use ObserverList::Notify() in shell/browser/serial/serial_chooser_context.cc

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

* refactor: use ObserverList::Notify() in shell/browser/native_window.cc

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

* refactor: use ObserverList::Notify() in shell/browser/serial/electron_serial_delegate.cc

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

* refactor: use ObserverList::Notify() in shell/browser/browser.cc

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

* refactor: use ObserverList::Notify() in shell/browser/api/electron_api_web_contents.cc

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

* refactor: use ObserverList::Notify() in shell/browser/hid/electron_hid_delegate.cc

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

* refactor: use ObserverList::Notify() in shell/browser/hid/hid_chooser_context.cc

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-05-02 07:51:05 -05:00
trop[bot]
1687b95849
fix: revert macOS content protection logic refactor (#46890)
Revert "refactor: use upstream content protection logic on macOS (#46813)"

This reverts commit 34adb976b6.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2025-05-01 14:57:32 -07:00
trop[bot]
c24f330b45
refactor: add EmitDeprecationWarning helper (#46879)
* refactor: add EmitDeprecationWarning helper

Also switches EmitWarning to using Node's ProcessEmitWarningGeneric

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* chore: use node namespace for function call

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-05-01 09:44:59 -05:00
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