* feat: add menu item role `palette` and `header`
* adds comments
* refactors new role items to new item types
* docs: custom type
* docs: note types only available on mac 14+
---------
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
* refactor: make NativeWindow::is_modal_ const
* refactor: make NativeWindow::title_bar_style_ const and private
* refactor: make NativeWindow::has_client_frame() protected
refactor: make NativeWindow::transparent() protected
* refactor: make NativeWindow::enable_larger_than_screen() protected
* refactor: make NativeWindow::has_frame_ const
* fixup! refactor: make NativeWindow::has_client_frame() protected
fix: GetExpandedWindowSize()
* refactor: remove unnecessary downcast in MenuViews::PopupAt()
* refactor: pass a views::Widget as an arg to the ElectronDesktopWindowTreeHostLinux ctor
* refactor: pass a views::Widget as an arg to the ElectronDesktopNativeWidgetAura ctor
* refactor: pass a views::Widget as an arg to the ElectronDesktopWindowTreeHostWin ctor
* refactor: create desktop_window_tree_host_ in the ElectronDesktopNativeWidgetAura constructor
* fixup! refactor: create desktop_window_tree_host_ in the ElectronDesktopNativeWidgetAura constructor
fix: tyop
* refactor: use in-class member initialization for NativeWindow::widget_
* refactor: make NativeWindow::transparent_ const
refactor: make NativeWindow::enable_larger_than_screen_ const
* chore: make linter happy after rebase
* refactor: use base::circular_deque in ResolveProxyHelper
* refactor: use base::circular_deque in GetExtraCrashKeys()
refactor: reduce visibility of kMaxCrashKeyValueSize
This change is to match Chromium's usage advice from
base/containers/README.md: `base:circular_deque` is preferred over
`std::deque` to provide consistent performance across platforms.
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."
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.
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
* refactor: make TrackableObject::weak_map_id() constexpr
refactor: make BaseWindow::GetID() inline and constexpr
* refactor: make NativeWindow::window_id() constexpr too
* refactor: use x11_util::IsX11() in BuildSubmenuFromModel()
* refactor: use x11_util::IsX11() in ElectronDesktopWindowTreeHostLinux::OnBoundsChanged()
* refactor: use skia_can_fall_back_to_x11 in x11_util::IsX11()
it is identical in practice to electron_can_call_x11 and does not require a Chromium patch
* chore: remove introduce_ozoneplatform_electron_can_call_x11_property.patch
* refactor: use ui::GetOzonePlatformId() to test for x11
* 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
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.
* 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: Deepak Mohan <hop2deep@gmail.com>
* refactor: do not use native_widget_private() in NativeWindowViews::SetContentProtection()
refactor: do not use native_widget_private() in NativeWindowViews::IsContentProtected()
* refactor: do not use native_widget_private() in NativeWindowViews::Show()
* chore: remove native_widget_private #include from native_window_views_win
Not needed since Feb 2025: 9199d5c6
* feat: add gin_helper::Dictionary::ValueOrDefault()
A convenience function for using a default value if the
specified key isn't present in the dictionary.
* refactor: use ValueOrDefault() in native_window.cc
* refactor: use ValueOrDefault() in native_window_mac.mm
* refactor: use ValueOrDefault() in native_window_views.cc
* refactor: use ValueOrDefault() in electron_api_native_image.cc
* 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
* chore: use dbus thread for portal version detection
* Update shell/browser/ui/file_dialog_linux_portal.cc
Co-authored-by: Robo <hop2deep@gmail.com>
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use ObserverList::Notify() in shell/browser/window_list.cc
* refactor: use ObserverList::Notify() in shell/browser/web_contents_zoom_controller.cc
* refactor: use ObserverList::Notify() in shell/browser/usb/usb_chooser_context.cc
* refactor: use ObserverList::Notify() in shell/browser/usb/electron_usb_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/views/menu_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/tray_icon.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/electron_menu_model.cc
* refactor: use ObserverList::Notify() in shell/browser/serial/serial_chooser_context.cc
* refactor: use ObserverList::Notify() in shell/browser/native_window.cc
* refactor: use ObserverList::Notify() in shell/browser/serial/electron_serial_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/browser.cc
* refactor: use ObserverList::Notify() in shell/browser/api/electron_api_web_contents.cc
* refactor: use ObserverList::Notify() in shell/browser/hid/electron_hid_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/hid/hid_chooser_context.cc