From 530a8b73766dc54736ae6de9528683b27430eaa6 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Wed, 8 Mar 2023 15:12:45 +0200 Subject: [PATCH] fix(linux): disable system appearance for scrollbars (#897) * fix(linux): disable system appearance for scrollbars * Update mod.rs * Update src/webview/webkitgtk/mod.rs Co-authored-by: Ngo Iok Ui (Wu Yu Wei) --------- Co-authored-by: Ngo Iok Ui (Wu Yu Wei) --- .changes/scrolbar-linux.md | 5 +++++ src/webview/webkitgtk/mod.rs | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changes/scrolbar-linux.md diff --git a/.changes/scrolbar-linux.md b/.changes/scrolbar-linux.md new file mode 100644 index 000000000..87b90be25 --- /dev/null +++ b/.changes/scrolbar-linux.md @@ -0,0 +1,5 @@ +--- +"wry": "patch" +--- + +On Linux, disable system appearance for scrollbars. diff --git a/src/webview/webkitgtk/mod.rs b/src/webview/webkitgtk/mod.rs index 1f3c87f8f..f26fdd24d 100644 --- a/src/webview/webkitgtk/mod.rs +++ b/src/webview/webkitgtk/mod.rs @@ -266,6 +266,11 @@ impl InnerWebView { } webview.grab_focus(); + if let Some(context) = WebViewExt::context(&*webview) { + use webkit2gtk::WebContextExt; + context.set_use_system_appearance_for_scrollbars(false); + } + // Enable webgl, webaudio, canvas features as default. if let Some(settings) = WebViewExt::settings(&*webview) { settings.set_enable_webgl(true);