Просмотр исходного кода

prevent the reload shortcut on windows (#2654)

Evan Almloff 11 месяцев назад
Родитель
Сommit
1dcfc44c23
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      packages/desktop/src/webview.rs

+ 7 - 0
packages/desktop/src/webview.rs

@@ -142,6 +142,13 @@ impl WebviewInstance {
             WebViewBuilder::new_gtk(vbox)
         };
 
+        // Disable the webview default shortcuts to disable the reload shortcut
+        #[cfg(target_os = "windows")]
+        {
+            use wry::WebViewBuilderExtWindows;
+            webview = webview.with_browser_accelerator_keys(false);
+        }
+
         webview = webview
             .with_transparent(cfg.window.window.transparent)
             .with_url("dioxus://index.html/")