Skip to content

Commit b237434

Browse files
committed
Update IsNonClientRegionSupportEnabled.md
1 parent 5224864 commit b237434

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

specs/IsNonClientRegionSupportEnabled.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Background
22

3-
To improve the developer experience for customizing non-client regions, WebView2 is working to support using DOM elements as nonclient regions. We currently have limited support for title bar aka draggable regions, and are working on building out support for caption control and resize regions.
3+
To improve the developer experience for customizing non-client regions, WebView2 is working to support using DOM elements as non-client regions. We currently have limited support for title bar aka draggable regions and are working on building out support for caption control and resize regions.
44

5-
For security and flexibility, we want developers to be able to enable or disable all custom nonclient functionality per WebView. Nonclient functionality will affect that app window's size and position so it's important that developers can definitively toggle access. This can be achieved in a limited way using a feature flag, but feature flags are applied per WebView2 environment, thus, an API on the WebView2 to enable/disable nonclient support via a setting is the better solution.
5+
For security and flexibility, we want developers to be able to enable or disable all custom nonclient functionality per WebView. Nonclient functionality will affect that app windows size and position so its important that developers can definitively toggle access.This can be achieved in a limited way using a feature flag, but feature flags are applied per WebView2 environment, thus, an API on the WebView2 to enable/disable nonclient support via a setting is the better solution.
66

77
# Description
8-
`IsNonClientRegionSupportEnabled` defaults to `false`. Disabling/Enabling `IsNonClientRegionSupportEnabled` takes effect after the next navigation.
8+
`IsNonClientRegionSupportEnabled` defaults to `FALSE`. Disabling/Enabling `IsNonClientRegionSupportEnabled` takes effect after the next navigation. Currently, draggable regions are the only nonclient experience we have implemented. Eventually, this setting will expand to enable other nonclient functionality, such as resize and caption controls.
99

10-
When the setting is set to `true`, then the following non-client region support will be enabled:
11-
* Draggable Regions will support dragging of the app and webview, the title bar context menu upon right click, and the maximizing to fill the window and restoring the window size upon double click of the html element.
10+
When the setting is set to `TRUE`, then the following non-client region support will be enabled:
1211

13-
When set to `false`, then all non-client region support will be disabled.
14-
* Web pages will not be able to use the `app-region` CSS style.
12+
* Web pages will be able to use the `app-region` CSS style.
13+
14+
* Draggable Regions declared with the CSS style `app-region: drag` will support title bar functionality, for example, the dragging of the app window, the title bar context menu upon right click, and the maximizing/ restoring of the window size upon double click of the html element.
15+
16+
When set to `FALSE`, then all non-client region support will be disabled.
17+
18+
* Web pages will not be able to use the `app-region` CSS style.
1519

1620
# Examples
1721
```cpp
@@ -27,7 +31,7 @@ void SettingsComponent::ToggleNonClientRegionSupportEnabled()
2731
{
2832
BOOL enabled;
2933
CHECK_FAILURE(coreWebView2Settings9->get_IsNonClientRegionSupportEnabled(&enabled));
30-
CHECK_FAILURE(coreWebView2Settings9->put_IsNonClientRegionSupportEnabled(enabled ? FALSE : TRUE));
34+
CHECK_FAILURE(coreWebView2Settings9->put_IsNonClientRegionSupportEnabled(!enabled));
3135
}
3236
}
3337
```
@@ -41,7 +45,7 @@ void ToggleNonClientRegionSupportEnabled()
4145
```
4246

4347
# Remarks
44-
If the flag is used to enable draggable regions in additional browser arguments, draggable region support will remain enabled even if `IsNonClientRegionSupportEnabled` setting is `false`.
48+
If the flag is used to enable draggable regions in additional browser arguments, draggable region support will remain enabled even if `IsNonClientRegionSupportEnabled` setting is `FALSE`.
4549

4650
# API Notes
4751
See [API Details](#api-details) section below for API reference.

0 commit comments

Comments
 (0)