feat: enable Windows Control Overlay on Linux #41769
Open
trop / Backportable? - 28-x-y
completed
May 23, 2024 in 12s
Backport Failed
This PR was checked and could not be automatically backported to "28-x-y" cleanly
Details
Failed Diff:
diff --cc docs/api/browser-window.md
index 3af05f03ad,d9e3039f2b..0000000000
--- a/docs/api/browser-window.md
+++ b/docs/api/browser-window.md
@@@ -1580,48 -1370,12 +1580,57 @@@ machine has a touch bar
**Note:** The TouchBar API is currently experimental and may change or be
removed in future Electron releases.
++<<<<<<< HEAD:docs/api/browser-window.md
+#### `win.setBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`.
+If there are other `BrowserView`s attached, they will be removed from
+this window.
+
+#### `win.getBrowserView()` _Experimental_
+
+Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null`
+if one is not attached. Throws an error if multiple `BrowserView`s are attached.
+
+#### `win.addBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+Replacement API for setBrowserView supporting work with multi browser views.
+
+#### `win.removeBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+#### `win.setTopBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+Raises `browserView` above other `BrowserView`s attached to `win`.
+Throws an error if `browserView` is not attached to `win`.
+
+#### `win.getBrowserViews()` _Experimental_
+
+Returns `BrowserView[]` - a sorted by z-index array of all BrowserViews that have been attached
+with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
+
+**Note:** The BrowserView API is currently experimental and may change or be
+removed in future Electron releases.
+
+#### `win.setTitleBarOverlay(options)` _Windows_
+
+* `options` Object
+ * `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled.
+ * `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled.
+ * `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels.
++=======
+ #### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
+
+ * `options` Object
+ * `color` String (optional) - The CSS color of the Window Controls Overlay when enabled.
+ * `symbolColor` String (optional) - The CSS color of the symbols on the Window Controls Overlay when enabled.
+ * `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels.
++>>>>>>> feat: enable Windows Control Overlay on Linux:docs/api/base-window.md
On a Window with Window Controls Overlay already enabled, this method updates
the style of the title bar overlay.
diff --cc shell/browser/ui/views/win_frame_view.cc
index 7525a5fd1c,9caebc7dd4..0000000000
--- a/shell/browser/ui/views/win_frame_view.cc
+++ b/shell/browser/ui/views/win_frame_view.cc
@@@ -173,11 -166,7 +171,15 @@@ bool WinFrameView::IsMaximized() const
return frame()->IsMaximized();
}
++<<<<<<< HEAD
+bool WinFrameView::ShouldCustomDrawSystemTitlebar() const {
+ return window()->IsWindowControlsOverlayEnabled();
+}
+
+void WinFrameView::Layout() {
++=======
+ void WinFrameView::Layout(PassKey) {
++>>>>>>> feat: enable Windows Control Overlay on Linux
LayoutCaptionButtons();
if (window()->IsWindowControlsOverlayEnabled()) {
LayoutWindowControlsOverlay();
diff --cc shell/browser/ui/views/win_frame_view.h
index bc52951f60,b57c3cdc77..0000000000
--- a/shell/browser/ui/views/win_frame_view.h
+++ b/shell/browser/ui/views/win_frame_view.h
@@@ -39,11 -41,6 +39,14 @@@ class WinFrameView : public FramelessVi
const gfx::Rect& client_bounds) const override;
int NonClientHitTest(const gfx::Point& point) override;
++<<<<<<< HEAD
+ // views::View:
+ const char* GetClassName() const override;
+
+ NativeWindowViews* window() const { return window_; }
+ views::Widget* frame() const { return frame_; }
++=======
++>>>>>>> feat: enable Windows Control Overlay on Linux
WinCaptionButtonContainer* caption_button_container() {
return caption_button_container_;
}
Annotations
Check failure on line 1624 in docs/api/browser-window.md
trop / Backportable? - 28-x-y
docs/api/browser-window.md#L1583-L1624
Patch Conflict
Raw output
++<<<<<<< HEAD:docs/api/browser-window.md
+#### `win.setBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`.
+If there are other `BrowserView`s attached, they will be removed from
+this window.
+
+#### `win.getBrowserView()` _Experimental_
+
+Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null`
+if one is not attached. Throws an error if multiple `BrowserView`s are attached.
+
+#### `win.addBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+Replacement API for setBrowserView supporting work with multi browser views.
+
+#### `win.removeBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+#### `win.setTopBrowserView(browserView)` _Experimental_
+
+* `browserView` [BrowserView](browser-view.md)
+
+Raises `browserView` above other `BrowserView`s attached to `win`.
+Throws an error if `browserView` is not attached to `win`.
+
+#### `win.getBrowserViews()` _Experimental_
+
+Returns `BrowserView[]` - a sorted by z-index array of all BrowserViews that have been attached
+with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
+
+**Note:** The BrowserView API is currently experimental and may change or be
+removed in future Electron releases.
+
+#### `win.setTitleBarOverlay(options)` _Windows_
+
+* `options` Object
+ * `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled.
+ * `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled.
+ * `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels.
++=======
+ #### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
+
+ * `options` Object
+ * `color` String (optional) - The CSS color of the Window Controls Overlay when enabled.
+ * `symbolColor` String (optional) - The CSS color of the symbols on the Window Controls Overlay when enabled.
+ * `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels.
++>>>>>>> feat: enable Windows Control Overlay on Linux:docs/api/base-window.md
Check failure on line 178 in shell/browser/ui/views/win_frame_view.cc
trop / Backportable? - 28-x-y
shell/browser/ui/views/win_frame_view.cc#L174-L178
Patch Conflict
Raw output
++<<<<<<< HEAD
+bool WinFrameView::ShouldCustomDrawSystemTitlebar() const {
+ return window()->IsWindowControlsOverlayEnabled();
+}
+
+void WinFrameView::Layout() {
++=======
+ void WinFrameView::Layout(PassKey) {
++>>>>>>> feat: enable Windows Control Overlay on Linux
Check failure on line 46 in shell/browser/ui/views/win_frame_view.h
trop / Backportable? - 28-x-y
shell/browser/ui/views/win_frame_view.h#L42-L46
Patch Conflict
Raw output
++<<<<<<< HEAD
+ // views::View:
+ const char* GetClassName() const override;
+
+ NativeWindowViews* window() const { return window_; }
+ views::Widget* frame() const { return frame_; }
++=======
++>>>>>>> feat: enable Windows Control Overlay on Linux