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>
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>
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>
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>
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>
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>
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>
* 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>
* 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>
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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
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>
* 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>
refactor: use v8::String::Empty() when creating empty strings
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use absl::flat_hash_set in SpellCheckClient::SpellCheckText()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use absl::flat_hash_set in MessagePort::DisentanglePorts()
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>
perf: avoid 3x call to GetID() in RegisterPendingSiteInstance()
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification()
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: avoid a redundant map lookuop in GetStorageMask()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: avoid a redundant map lookup in GetDataTypeMask()
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>
fix: emit `context-menu` event in Windows draggable regions (#46032)
fix: emit context-menu event in Windows draggable regions
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
perf: avoid a triple-redundant map lookup in ViewsDelegate::GetAppbarAutohideEdges()
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
fix: ftbfs when printing is disabled
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>