Skip to content

Commit 74f87da

Browse files
authored
Improve compat w/ X11 and Wayland on linux (#155)
* Improve compat w/ X11 and Wayland on linux * Move unix import in linux cfg scope
1 parent bb10a40 commit 74f87da

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,17 @@ pub fn run(webview_options: Options) -> wry::Result<()> {
496496
if let Some(user_agent) = webview_options.user_agent {
497497
webview_builder = webview_builder.with_user_agent(user_agent.as_str());
498498
}
499+
#[cfg(not(target_os = "linux"))]
499500
let webview = webview_builder.build(&window)?;
500501

502+
#[cfg(target_os = "linux")]
503+
let webview = {
504+
use tao::platform::unix::WindowExtUnix;
505+
use wry::WebViewBuilderExtUnix;
506+
let vbox = window.default_vbox().unwrap();
507+
webview_builder.build_gtk(vbox)?
508+
};
509+
501510
let notify_tx = tx.clone();
502511
let notify = move |notification: Notification| {
503512
debug!(notification = ?notification, "Sending notification to client");

0 commit comments

Comments
 (0)