From 5d6debbd1207ad4c8b69863bd0f10e588df37211 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:40:15 -0700 Subject: [PATCH 01/23] Create IsWindowControlsOverlayEnabled.md --- specs/IsWindowControlsOverlayEnabled.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 specs/IsWindowControlsOverlayEnabled.md diff --git a/specs/IsWindowControlsOverlayEnabled.md b/specs/IsWindowControlsOverlayEnabled.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/specs/IsWindowControlsOverlayEnabled.md @@ -0,0 +1 @@ + From 5a4eb5f875d86dcc7fe89c5f23f2b921d4cb31d8 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha Date: Tue, 4 Jun 2024 14:34:51 -0700 Subject: [PATCH 02/23] Included a new API spec for Webview2 Window Controls Overlay --- specs/IsWindowControlsOverlayEnabled.md | 1 - specs/WindowControlsOverlayConfiguration.md | 142 ++++++++++++++++++++ 2 files changed, 142 insertions(+), 1 deletion(-) delete mode 100644 specs/IsWindowControlsOverlayEnabled.md create mode 100644 specs/WindowControlsOverlayConfiguration.md diff --git a/specs/IsWindowControlsOverlayEnabled.md b/specs/IsWindowControlsOverlayEnabled.md deleted file mode 100644 index 8b1378917..000000000 --- a/specs/IsWindowControlsOverlayEnabled.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md new file mode 100644 index 000000000..1d4ac0ee2 --- /dev/null +++ b/specs/WindowControlsOverlayConfiguration.md @@ -0,0 +1,142 @@ +WebView2 Window Controls +=== + +# Background +This API allows you to Enable and configure The Webview2 Window Controls overlay. +The Overlay is a region on the top right/left of the webview window which contains +the caption buttons (minimize, maximize, restore, close). Enabing the Overlay allows +for custom app title bars rendered completly inside the webview window. +The overlay Settings lives on the controller object. + +This API is designed to be used in addition with the other non-client region APIs +and features. These include `app-region: drag`, and `IsNonClientRegionSupportEnabled`. +# Examples + +## Win32 C++ +```cpp +AppWindow::AppWindow() { + m_mainWindow = CreateWindowExW( + WS_EX_CONTROLPARENT, + GetWindowClass(), + L"" + WS_POPUPWINDOW, + 0,0, 800, 800, + nullptr, nullptr, + g_hInstance, nullptr); +} + +void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Controller* controller) +{ + wil::com_ptr controller5; + CHECK_FAILURE(controller->QueryInterface(&controller5)); + + wil::com_ptr wco_config; + CHECK_FAILURE(controller5->get_WindowControlsOverlaySettings(&wco_config)); + + wco_config->put_IsEnabled(true); + COREWEBVIEW2_COLOR color {1, 0, 0, 225}; + wco_config->put_TitleBarColor(color); +} +``` +## .NET C# +```c# +// WebView2 control is defined in the xaml +// +public MainWindow() +{ + InitializeComponent(); + m_AppWindow.TitleBar.ExtendsContentIntoTitleBar = true; + + CoreWebView2WindowControlsOverlaySettings config = _coreWebView2Controller.WindowControlsOverlaySettings; + config.IsEnabled = true; + config.color = Color.FromARGB(0, 0, 255); +} +``` + +# API Details +## Win32 C++ +```cpp +/// Controller API used to configure the window controls overlay. +/// To provide your app users with the best experience, it is important to handle webview +/// initialization errors appropriatly. Provide your users with a way to close the window +/// or restart the App. +[uuid(101e36ca-7f75-5105-b9be-fea2ba61a2fd), object, pointer_default(unique)] +interface ICoreWebView2Controller5 : IUnknown { + /// Gets the `WindowControlsOverlaySettings` object. + [propget] HRESULT WindowControlsOverlaySettings([out, retval] ICoreWebView2WindowControlsOverlaySettings** value); +} + +/// This is the ICoreWebView2WindowControlsOverlaySettings +[uuid(c9f7378b-8dbb-5445-bacb-08a3fdf032f0), object, pointer_default(unique)] +interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { + /// Gets the `Height` property. + [propget] HRESULT Height([out, retval] UINT32* value); + + + /// The `Height` property in raw screen pixels, allows you to set the height of the overlay and + /// title bar area. Defaults to 48px. + /// + [propput] HRESULT Height([in] UINT32 value); + + + /// Gets the `IsEnabled` property. + [propget] HRESULT IsEnabled([out, retval] BOOL* value); + + + /// The `IsEnabled` property allows you to opt in to using + /// the WebView2 window controls overlay. Defaults to `FALSE`. + /// + /// When this property is `TRUE`, WebView2 will draw its own minimize, maximize, + /// and close buttons on the top right corner of the Webview2. + /// + /// When using this you should configure your app window to not display its default + /// window control buttons. You are responsible for creating a title bar for your app + /// by using the available space to the left of the controls overlay. In doing so, + /// you can utilize the [IsNonClientRegionSupportEnabled](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings9?view=webview2-1.0.2739.15) + /// API to enable draggable regions for your custom title bar. + /// + /// The Overlay buttons will sit on top of the HTML content, and will prevent mouse interactions + /// with any elements directly below it, so you should avoid placing content there. + /// To that end, there are four CSS environment vairables defined to help you + /// get the dimensions of the available titlebar area to the left of the overlay. + /// Similarly the navigator object wil contain a WindowControlsOverlay property + /// which can be used to get the titlebar area as a rect, and listen for changes + /// to the size of that area. + /// + [propput] HRESULT IsEnabled([in] BOOL value); + + /// Gets the `TitleBarColor` property. + [propget] HRESULT TitleBarColor([out, retval] COREWEBVIEW2_COLOR* value); + + /// The `TitleBarColor` property allows you to set a background color + /// for the overlay. Based on the background color you choose, Webview2 + ///will automatically calculate a foreground and hover color that will + /// provide you the best contrast while maintaining accessibility. + /// Defaults to #f3f3f3 + [propput] HRESULT TitleBarColor([in] COREWEBVIEW2_COLOR value); +} +``` + +## .NET and WinRT +```c# +namespace Microsoft.Web.WebView2.Core +{ + runtimeclass CoreWebView2Controller + { + [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2Controller")] + { + CoreWebView2WindowControlsOverlaySettings WindowControlsOverlaySettings { get; }; + } + } + + runtimeclass CoreWebView2WindowControlsOverlaySettings + { + [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2WindowControlsOverlaySettings")] + { + Boolean IsEnabled { get; set; }; + UInt32 Height { get; set; }; + System.Drawing.Color TitleBarColor { get; set; } + } + } +} +``` From 4bc0b7a5cec4fbc41ee94ffc2a23ede457fadccf Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:18:16 -0700 Subject: [PATCH 03/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 1d4ac0ee2..76f446cf2 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -135,7 +135,7 @@ namespace Microsoft.Web.WebView2.Core { Boolean IsEnabled { get; set; }; UInt32 Height { get; set; }; - System.Drawing.Color TitleBarColor { get; set; } + Windows.UI.Color TitleBarColor { get; set; } } } } From a4026d9ccde7d9c208409f66265e53504fceca17 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:18:26 -0700 Subject: [PATCH 04/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 76f446cf2..752dd095d 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -113,7 +113,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { ///will automatically calculate a foreground and hover color that will /// provide you the best contrast while maintaining accessibility. /// Defaults to #f3f3f3 - [propput] HRESULT TitleBarColor([in] COREWEBVIEW2_COLOR value); + [propput] HRESULT TitleBarBackgroundColor([in] COREWEBVIEW2_COLOR value); } ``` From 17145781ea3c1fe8f514f3893eba1f1fad05cd97 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:18:35 -0700 Subject: [PATCH 05/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 752dd095d..e964b9f4e 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -2,7 +2,7 @@ WebView2 Window Controls === # Background -This API allows you to Enable and configure The Webview2 Window Controls overlay. +This API allows you to enable and configure the Webview2 Window Controls Overlay. The Overlay is a region on the top right/left of the webview window which contains the caption buttons (minimize, maximize, restore, close). Enabing the Overlay allows for custom app title bars rendered completly inside the webview window. From b89c17855172ffc0f96d494eb649f2c8382f4b86 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:18:46 -0700 Subject: [PATCH 06/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index e964b9f4e..8bb504719 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -5,7 +5,7 @@ WebView2 Window Controls This API allows you to enable and configure the Webview2 Window Controls Overlay. The Overlay is a region on the top right/left of the webview window which contains the caption buttons (minimize, maximize, restore, close). Enabing the Overlay allows -for custom app title bars rendered completly inside the webview window. +for custom app title bars rendered completely inside the webview window. The overlay Settings lives on the controller object. This API is designed to be used in addition with the other non-client region APIs From 1221980bc026633ecd4eab96e243b5ce525accdb Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:18:55 -0700 Subject: [PATCH 07/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 8bb504719..db4b152dc 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -58,7 +58,7 @@ public MainWindow() ```cpp /// Controller API used to configure the window controls overlay. /// To provide your app users with the best experience, it is important to handle webview -/// initialization errors appropriatly. Provide your users with a way to close the window +/// initialization errors appropriately. Provide your users with a way to close the window /// or restart the App. [uuid(101e36ca-7f75-5105-b9be-fea2ba61a2fd), object, pointer_default(unique)] interface ICoreWebView2Controller5 : IUnknown { From 8ff7c9ef5a2081c153894dbc4c4b958ea90cc833 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:19:58 -0700 Subject: [PATCH 08/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index db4b152dc..19b018f85 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -99,7 +99,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// with any elements directly below it, so you should avoid placing content there. /// To that end, there are four CSS environment vairables defined to help you /// get the dimensions of the available titlebar area to the left of the overlay. - /// Similarly the navigator object wil contain a WindowControlsOverlay property + /// Similarly the navigator object wil contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) /// which can be used to get the titlebar area as a rect, and listen for changes /// to the size of that area. /// From 01a2cafbf0383a2a84847c89e57247bb8ba98499 Mon Sep 17 00:00:00 2001 From: Tochukwu Ibe-Ekeocha <114026179+tochukwuIbeEkeocha@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:20:17 -0700 Subject: [PATCH 09/23] Update specs/WindowControlsOverlayConfiguration.md --- specs/WindowControlsOverlayConfiguration.md | 50 +++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 19b018f85..761ee8027 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -6,10 +6,15 @@ This API allows you to enable and configure the Webview2 Window Controls Overlay The Overlay is a region on the top right/left of the webview window which contains the caption buttons (minimize, maximize, restore, close). Enabing the Overlay allows for custom app title bars rendered completely inside the webview window. -The overlay Settings lives on the controller object. This API is designed to be used in addition with the other non-client region APIs and features. These include `app-region: drag`, and `IsNonClientRegionSupportEnabled`. + +# Conceptual pages (How To) +Here is a concept doc on the window controls overlay: https://wicg.github.io/window-controls-overlay/#concepts. +This was written for the PWA counterpart for this feature. From the perspective of +HTML & Javascript layers, everything there applies in Webview2 as well. + # Examples ## Win32 C++ @@ -27,15 +32,19 @@ AppWindow::AppWindow() { void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Controller* controller) { - wil::com_ptr controller5; - CHECK_FAILURE(controller->QueryInterface(&controller5)); - wil::com_ptr wco_config; - CHECK_FAILURE(controller5->get_WindowControlsOverlaySettings(&wco_config)); + wil::com_ptr coreWebView2; + CHECK_FAILURE(m_controller->get_CoreWebView2(&coreWebView2)); + + wil::com_ptr coreWebView2_28; + CHECK_FAILURE(coreWebView2->QueryInterface(&coreWebView2_28)); - wco_config->put_IsEnabled(true); + wil::com_ptr windowControlsOverlaySettings; + CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlaySettings(&wco_config)); + + CHECK_FAILURE(wco_config->put_IsEnabled(true)); COREWEBVIEW2_COLOR color {1, 0, 0, 225}; - wco_config->put_TitleBarColor(color); + CHECK_FAILURE(wco_config->put_TitleBarBackgroundColor(color)); } ``` ## .NET C# @@ -47,7 +56,7 @@ public MainWindow() InitializeComponent(); m_AppWindow.TitleBar.ExtendsContentIntoTitleBar = true; - CoreWebView2WindowControlsOverlaySettings config = _coreWebView2Controller.WindowControlsOverlaySettings; + CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebivew2.WindowControlsOverlaySettings; config.IsEnabled = true; config.color = Color.FromARGB(0, 0, 255); } @@ -61,7 +70,7 @@ public MainWindow() /// initialization errors appropriately. Provide your users with a way to close the window /// or restart the App. [uuid(101e36ca-7f75-5105-b9be-fea2ba61a2fd), object, pointer_default(unique)] -interface ICoreWebView2Controller5 : IUnknown { +interface ICoreWebView2_28 : IUnknown { /// Gets the `WindowControlsOverlaySettings` object. [propget] HRESULT WindowControlsOverlaySettings([out, retval] ICoreWebView2WindowControlsOverlaySettings** value); } @@ -74,7 +83,10 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// The `Height` property in raw screen pixels, allows you to set the height of the overlay and - /// title bar area. Defaults to 48px. + /// title bar area. Defaults to 48px. There is no minimum height restriction for this API, + /// so it is up to the developer to make sure that the height of your window controls overlay + /// is enough that users can see and interact with it. We recommend using GetSystemMetrics(SM_CYCAPTION) + // as you minimum height. /// [propput] HRESULT Height([in] UINT32 value); @@ -97,7 +109,8 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// /// The Overlay buttons will sit on top of the HTML content, and will prevent mouse interactions /// with any elements directly below it, so you should avoid placing content there. - /// To that end, there are four CSS environment vairables defined to help you + /// To that end, there are four [CSS environment vairables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) + /// titlebar-area-x, titlebar-area-y, titlebar-area-width defined to help you /// get the dimensions of the available titlebar area to the left of the overlay. /// Similarly the navigator object wil contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) /// which can be used to get the titlebar area as a rect, and listen for changes @@ -105,14 +118,14 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// [propput] HRESULT IsEnabled([in] BOOL value); - /// Gets the `TitleBarColor` property. - [propget] HRESULT TitleBarColor([out, retval] COREWEBVIEW2_COLOR* value); + /// Gets the `TitleBarBackgroundColor` property. + [propget] HRESULT TitleBarBackgroundColor([out, retval] COREWEBVIEW2_COLOR* value); - /// The `TitleBarColor` property allows you to set a background color + /// The `TitleBarBackgroundColor` property allows you to set a background color /// for the overlay. Based on the background color you choose, Webview2 ///will automatically calculate a foreground and hover color that will /// provide you the best contrast while maintaining accessibility. - /// Defaults to #f3f3f3 + /// Defaults to #f3f3f3. This API supports transparency. [propput] HRESULT TitleBarBackgroundColor([in] COREWEBVIEW2_COLOR value); } ``` @@ -121,9 +134,9 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { ```c# namespace Microsoft.Web.WebView2.Core { - runtimeclass CoreWebView2Controller + runtimeclass CoreWebView2 { - [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2Controller")] + [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2_28")] { CoreWebView2WindowControlsOverlaySettings WindowControlsOverlaySettings { get; }; } @@ -135,8 +148,9 @@ namespace Microsoft.Web.WebView2.Core { Boolean IsEnabled { get; set; }; UInt32 Height { get; set; }; - Windows.UI.Color TitleBarColor { get; set; } + Windows.UI.Color TitleBarBackgroundColor { get; set; } } } } ``` + From abbe2c21b6dd92516c1213b959b71e594967ba99 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:40:51 +0530 Subject: [PATCH 10/23] Fix Typo in specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 761ee8027..0bd076b03 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -4,7 +4,7 @@ WebView2 Window Controls # Background This API allows you to enable and configure the Webview2 Window Controls Overlay. The Overlay is a region on the top right/left of the webview window which contains -the caption buttons (minimize, maximize, restore, close). Enabing the Overlay allows +the caption buttons (minimize, maximize, restore, close). Enabling the Overlay allows for custom app title bars rendered completely inside the webview window. This API is designed to be used in addition with the other non-client region APIs From fa8e6e51912ba11d18ea5c3d9d654e1d7eee6b33 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:42:11 +0530 Subject: [PATCH 11/23] Fix Grammer in specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 0bd076b03..32015e3d3 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -86,7 +86,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// title bar area. Defaults to 48px. There is no minimum height restriction for this API, /// so it is up to the developer to make sure that the height of your window controls overlay /// is enough that users can see and interact with it. We recommend using GetSystemMetrics(SM_CYCAPTION) - // as you minimum height. + // as your minimum height. /// [propput] HRESULT Height([in] UINT32 value); From f3c9cf3e3d746f7f4e96cf9d1a473ab24904eb8d Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:42:37 +0530 Subject: [PATCH 12/23] Fix Typo specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 32015e3d3..071e8e10d 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -112,7 +112,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// To that end, there are four [CSS environment vairables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) /// titlebar-area-x, titlebar-area-y, titlebar-area-width defined to help you /// get the dimensions of the available titlebar area to the left of the overlay. - /// Similarly the navigator object wil contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) + /// Similarly the navigator object will contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) /// which can be used to get the titlebar area as a rect, and listen for changes /// to the size of that area. /// From ba722a885b1c000cf1d1a649c5efcb9bb4174964 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:44:08 +0530 Subject: [PATCH 13/23] Fix Spacing issue in specs/WindowControlsOverlayConfiguration.md Co-authored-by: Viktoria Zlatinova --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 071e8e10d..89bfd5fc5 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -123,7 +123,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// The `TitleBarBackgroundColor` property allows you to set a background color /// for the overlay. Based on the background color you choose, Webview2 - ///will automatically calculate a foreground and hover color that will + /// will automatically calculate a foreground and hover color that will /// provide you the best contrast while maintaining accessibility. /// Defaults to #f3f3f3. This API supports transparency. [propput] HRESULT TitleBarBackgroundColor([in] COREWEBVIEW2_COLOR value); From 964f28b9e14026cd4c49c371fb1314c2354c3415 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:45:07 +0530 Subject: [PATCH 14/23] Casing fix specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 89bfd5fc5..e59119f95 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -58,7 +58,7 @@ public MainWindow() CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebivew2.WindowControlsOverlaySettings; config.IsEnabled = true; - config.color = Color.FromARGB(0, 0, 255); + config.Color = Color.FromARGB(0, 0, 255); } ``` From cfefaaece24eb3a4ab81578ef50db018d7037684 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:45:25 +0530 Subject: [PATCH 15/23] Fix Casing in specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index e59119f95..85cb7db01 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -56,7 +56,7 @@ public MainWindow() InitializeComponent(); m_AppWindow.TitleBar.ExtendsContentIntoTitleBar = true; - CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebivew2.WindowControlsOverlaySettings; + CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebView2.WindowControlsOverlaySettings; config.IsEnabled = true; config.Color = Color.FromARGB(0, 0, 255); } From 12b813408d1bcd0e462f56759e13a0cadb9de41e Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad <37590429+venky8951@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:46:01 +0530 Subject: [PATCH 16/23] Update specs/WindowControlsOverlayConfiguration.md Co-authored-by: David Risney --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 85cb7db01..88a57d57d 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -107,7 +107,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// you can utilize the [IsNonClientRegionSupportEnabled](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings9?view=webview2-1.0.2739.15) /// API to enable draggable regions for your custom title bar. /// - /// The Overlay buttons will sit on top of the HTML content, and will prevent mouse interactions + /// The Overlay buttons will cover the HTML content, and will prevent mouse interactions /// with any elements directly below it, so you should avoid placing content there. /// To that end, there are four [CSS environment vairables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) /// titlebar-area-x, titlebar-area-y, titlebar-area-width defined to help you From f34e47c098ef114d10328a38f0ae788605716d4f Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 11:43:07 +0530 Subject: [PATCH 17/23] Fix Varibale names --- specs/WindowControlsOverlayConfiguration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 88a57d57d..47a6565f8 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -39,12 +39,12 @@ void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Co wil::com_ptr coreWebView2_28; CHECK_FAILURE(coreWebView2->QueryInterface(&coreWebView2_28)); - wil::com_ptr windowControlsOverlaySettings; - CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlaySettings(&wco_config)); + wil::com_ptr windowControlsOverlay; + CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlaySettings(&windowControlsOverlay)); - CHECK_FAILURE(wco_config->put_IsEnabled(true)); + CHECK_FAILURE(windowControlsOverlay->put_IsEnabled(true)); COREWEBVIEW2_COLOR color {1, 0, 0, 225}; - CHECK_FAILURE(wco_config->put_TitleBarBackgroundColor(color)); + CHECK_FAILURE(windowControlsOverlay->put_TitleBarBackgroundColor(color)); } ``` ## .NET C# From 9790a1eb04fb8773c8be18ffa1425bc6a158612a Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 11:46:06 +0530 Subject: [PATCH 18/23] Add height Varibale in the comments line 113 --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 47a6565f8..5decfdf9b 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -110,7 +110,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// The Overlay buttons will cover the HTML content, and will prevent mouse interactions /// with any elements directly below it, so you should avoid placing content there. /// To that end, there are four [CSS environment vairables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) - /// titlebar-area-x, titlebar-area-y, titlebar-area-width defined to help you + /// titlebar-area-x, titlebar-area-y, titlebar-area-width, titlebar-area-height defined to help you /// get the dimensions of the available titlebar area to the left of the overlay. /// Similarly the navigator object will contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) /// which can be used to get the titlebar area as a rect, and listen for changes From 03905963dbef9c44f2245b50df68beae39c9bdfb Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 11:49:54 +0530 Subject: [PATCH 19/23] Change TitleBarBackgroundColor to BackgroundColor --- specs/WindowControlsOverlayConfiguration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 5decfdf9b..29a379e9e 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -44,7 +44,7 @@ void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Co CHECK_FAILURE(windowControlsOverlay->put_IsEnabled(true)); COREWEBVIEW2_COLOR color {1, 0, 0, 225}; - CHECK_FAILURE(windowControlsOverlay->put_TitleBarBackgroundColor(color)); + CHECK_FAILURE(windowControlsOverlay->put_BackgroundColor(color)); } ``` ## .NET C# @@ -118,15 +118,15 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// [propput] HRESULT IsEnabled([in] BOOL value); - /// Gets the `TitleBarBackgroundColor` property. - [propget] HRESULT TitleBarBackgroundColor([out, retval] COREWEBVIEW2_COLOR* value); + /// Gets the `BackgroundColor` property. + [propget] HRESULT BackgroundColor([out, retval] COREWEBVIEW2_COLOR* value); - /// The `TitleBarBackgroundColor` property allows you to set a background color + /// The `BackgroundColor` property allows you to set a background color /// for the overlay. Based on the background color you choose, Webview2 /// will automatically calculate a foreground and hover color that will /// provide you the best contrast while maintaining accessibility. /// Defaults to #f3f3f3. This API supports transparency. - [propput] HRESULT TitleBarBackgroundColor([in] COREWEBVIEW2_COLOR value); + [propput] HRESULT BackgroundColor([in] COREWEBVIEW2_COLOR value); } ``` @@ -148,7 +148,7 @@ namespace Microsoft.Web.WebView2.Core { Boolean IsEnabled { get; set; }; UInt32 Height { get; set; }; - Windows.UI.Color TitleBarBackgroundColor { get; set; } + Windows.UI.Color BackgroundColor { get; set; } } } } From 3d5d006c1bc6a0db755d7750bfba98a22979cfe3 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 11:54:14 +0530 Subject: [PATCH 20/23] Remove uncliamed statements --- specs/WindowControlsOverlayConfiguration.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 29a379e9e..4aabf85f2 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -123,8 +123,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// The `BackgroundColor` property allows you to set a background color /// for the overlay. Based on the background color you choose, Webview2 - /// will automatically calculate a foreground and hover color that will - /// provide you the best contrast while maintaining accessibility. + /// will automatically calculate a foreground and hover color. /// Defaults to #f3f3f3. This API supports transparency. [propput] HRESULT BackgroundColor([in] COREWEBVIEW2_COLOR value); } From 2397d9f1c9cfbbb0e7824704a0f2c5a28daae003 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 11:55:29 +0530 Subject: [PATCH 21/23] fix typo --- specs/WindowControlsOverlayConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 4aabf85f2..bb77664f9 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -109,7 +109,7 @@ interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { /// /// The Overlay buttons will cover the HTML content, and will prevent mouse interactions /// with any elements directly below it, so you should avoid placing content there. - /// To that end, there are four [CSS environment vairables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) + /// To that end, there are four [CSS environment variables](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API#css_environment_variables) /// titlebar-area-x, titlebar-area-y, titlebar-area-width, titlebar-area-height defined to help you /// get the dimensions of the available titlebar area to the left of the overlay. /// Similarly the navigator object will contain a [WindowControlsOverlay property](https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlay) From c880f4ac109408e0cca298c138a0df16496ae1e4 Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 12:00:33 +0530 Subject: [PATCH 22/23] rename WindowControlsOverlaySettings to WindowControlsOverlay --- specs/WindowControlsOverlayConfiguration.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index bb77664f9..30413819b 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -39,8 +39,8 @@ void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Co wil::com_ptr coreWebView2_28; CHECK_FAILURE(coreWebView2->QueryInterface(&coreWebView2_28)); - wil::com_ptr windowControlsOverlay; - CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlaySettings(&windowControlsOverlay)); + wil::com_ptr windowControlsOverlay; + CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlay(&windowControlsOverlay)); CHECK_FAILURE(windowControlsOverlay->put_IsEnabled(true)); COREWEBVIEW2_COLOR color {1, 0, 0, 225}; @@ -56,7 +56,7 @@ public MainWindow() InitializeComponent(); m_AppWindow.TitleBar.ExtendsContentIntoTitleBar = true; - CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebView2.WindowControlsOverlaySettings; + CoreWebView2WindowControlsOverlay config = Webview2.CoreWebView2.WindowControlsOverlay; config.IsEnabled = true; config.Color = Color.FromARGB(0, 0, 255); } @@ -71,13 +71,13 @@ public MainWindow() /// or restart the App. [uuid(101e36ca-7f75-5105-b9be-fea2ba61a2fd), object, pointer_default(unique)] interface ICoreWebView2_28 : IUnknown { - /// Gets the `WindowControlsOverlaySettings` object. - [propget] HRESULT WindowControlsOverlaySettings([out, retval] ICoreWebView2WindowControlsOverlaySettings** value); + /// Gets the `WindowControlsOverlay` object. + [propget] HRESULT WindowControlsOverlay([out, retval] ICoreWebView2WindowControlsOverlay** value); } -/// This is the ICoreWebView2WindowControlsOverlaySettings +/// This is the ICoreWebView2WindowControlsOverlay [uuid(c9f7378b-8dbb-5445-bacb-08a3fdf032f0), object, pointer_default(unique)] -interface ICoreWebView2WindowControlsOverlaySettings : IUnknown { +interface ICoreWebView2WindowControlsOverlay : IUnknown { /// Gets the `Height` property. [propget] HRESULT Height([out, retval] UINT32* value); @@ -137,13 +137,13 @@ namespace Microsoft.Web.WebView2.Core { [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2_28")] { - CoreWebView2WindowControlsOverlaySettings WindowControlsOverlaySettings { get; }; + CoreWebView2WindowControlsOverlay WindowControlsOverlay { get; }; } } - runtimeclass CoreWebView2WindowControlsOverlaySettings + runtimeclass CoreWebView2WindowControlsOverlay { - [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2WindowControlsOverlaySettings")] + [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2WindowControlsOverlay")] { Boolean IsEnabled { get; set; }; UInt32 Height { get; set; }; From b7f2a9720afa666b25d9e00d78ee9c4fad8b7ebc Mon Sep 17 00:00:00 2001 From: Venkatesh Prasad Date: Thu, 20 Feb 2025 12:01:39 +0530 Subject: [PATCH 23/23] rename IsEnabled to IsVisible --- specs/WindowControlsOverlayConfiguration.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specs/WindowControlsOverlayConfiguration.md b/specs/WindowControlsOverlayConfiguration.md index 30413819b..71864b52e 100644 --- a/specs/WindowControlsOverlayConfiguration.md +++ b/specs/WindowControlsOverlayConfiguration.md @@ -42,7 +42,7 @@ void AppWindow::OnCreateWebview2ControllerCompleted(HRESULT hr, ICoreWebview2Co wil::com_ptr windowControlsOverlay; CHECK_FAILURE(coreWebView2_28->get_WindowControlsOverlay(&windowControlsOverlay)); - CHECK_FAILURE(windowControlsOverlay->put_IsEnabled(true)); + CHECK_FAILURE(windowControlsOverlay->put_IsVisible(true)); COREWEBVIEW2_COLOR color {1, 0, 0, 225}; CHECK_FAILURE(windowControlsOverlay->put_BackgroundColor(color)); } @@ -57,7 +57,7 @@ public MainWindow() m_AppWindow.TitleBar.ExtendsContentIntoTitleBar = true; CoreWebView2WindowControlsOverlay config = Webview2.CoreWebView2.WindowControlsOverlay; - config.IsEnabled = true; + config.IsVisible = true; config.Color = Color.FromARGB(0, 0, 255); } ``` @@ -91,11 +91,11 @@ interface ICoreWebView2WindowControlsOverlay : IUnknown { [propput] HRESULT Height([in] UINT32 value); - /// Gets the `IsEnabled` property. - [propget] HRESULT IsEnabled([out, retval] BOOL* value); + /// Gets the `IsVisible` property. + [propget] HRESULT IsVisible([out, retval] BOOL* value); - /// The `IsEnabled` property allows you to opt in to using + /// The `IsVisible` property allows you to opt in to using /// the WebView2 window controls overlay. Defaults to `FALSE`. /// /// When this property is `TRUE`, WebView2 will draw its own minimize, maximize, @@ -116,7 +116,7 @@ interface ICoreWebView2WindowControlsOverlay : IUnknown { /// which can be used to get the titlebar area as a rect, and listen for changes /// to the size of that area. /// - [propput] HRESULT IsEnabled([in] BOOL value); + [propput] HRESULT IsVisible([in] BOOL value); /// Gets the `BackgroundColor` property. [propget] HRESULT BackgroundColor([out, retval] COREWEBVIEW2_COLOR* value); @@ -145,7 +145,7 @@ namespace Microsoft.Web.WebView2.Core { [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2WindowControlsOverlay")] { - Boolean IsEnabled { get; set; }; + Boolean IsVisible { get; set; }; UInt32 Height { get; set; }; Windows.UI.Color BackgroundColor { get; set; } }