Skip to content

Commit 731893a

Browse files
authored
Merge pull request #22408 from unoplatform/xwayland_webview
chore: make gtk webview windows undecorated
2 parents 3b961f7 + 7c33765 commit 731893a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/articles/controls/WebView.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public App()
168168
>
169169
> This feature will only work for security reasons when the application runs in Debug mode.
170170
171-
## X11 specifics
171+
## Linux specifics
172172

173173
In order to use WebView2 on Linux, you'll need to install `libwebkit2gtk` and `libgtk3-0`:
174174

@@ -186,6 +186,15 @@ In order to use WebView2 on Linux, you'll need to install `libwebkit2gtk` and `l
186186

187187
It's overall preferable to use libwebkit2gtk 4.1 whenever possible in order to get http headers support, if your environment allows for it.
188188

189+
### Wayland support
190+
191+
When running on a Wayland environment, the `WebView` control requires the environment variable `GDK_BACKEND` to be set to `x11` to function correctly.
192+
193+
```bash
194+
export GDK_BACKEND=x11
195+
dotnet run
196+
```
197+
189198
## WebResourceRequested
190199

191200
The `WebResourceRequested` event allows you to intercept and modify HTTP requests made by the WebView. This is useful for scenarios like injecting custom headers, implementing authentication, or modifying request/response content.

src/AddIns/Uno.UI.WebView.Skia.X11/X11NativeWebView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public X11NativeWebView(CoreWebView2 coreWebView2, ContentPresenter presenter)
140140
{
141141
var window = new Window(Gtk.WindowType.Toplevel);
142142
window.Title = _title;
143+
window.Decorated = false;
143144
var webview = new WebKit.WebView();
144145
webview.Settings.EnableSmoothScrolling = true;
145146
webview.Settings.EnableJavascript = true;

0 commit comments

Comments
 (0)