summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src-tauri/src
diff options
context:
space:
mode:
authorChris Yang <[email protected]>2026-01-26 17:50:51 -0700
committerGitHub <[email protected]>2026-01-26 18:50:51 -0600
commitd9e8b2b65d9fba4b54cb6a7f7d677162335c8e3f (patch)
treeb3a205cddf3ab7b121029f8bd5c62dd7186893b5 /packages/desktop/src-tauri/src
parent7655f51e101b318efe0e6a23e05052b344348a90 (diff)
downloadopencode-d9e8b2b65d9fba4b54cb6a7f7d677162335c8e3f.tar.gz
opencode-d9e8b2b65d9fba4b54cb6a7f7d677162335c8e3f.zip
fix(desktop): disable magnification gestures on macOS (#10605)
Diffstat (limited to 'packages/desktop/src-tauri/src')
-rw-r--r--packages/desktop/src-tauri/src/window_customizer.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/desktop/src-tauri/src/window_customizer.rs b/packages/desktop/src-tauri/src/window_customizer.rs
index cd42fd029..682f57f24 100644
--- a/packages/desktop/src-tauri/src/window_customizer.rs
+++ b/packages/desktop/src-tauri/src/window_customizer.rs
@@ -29,6 +29,18 @@ impl<R: Runtime> Plugin<R> for PinchZoomDisablePlugin {
gobject_ffi::g_signal_handlers_destroy(data.as_ptr().cast());
}
}
+
+ #[cfg(target_os = "macos")]
+ unsafe {
+ use objc2::rc::Retained;
+ use objc2_web_kit::WKWebView;
+
+ // Get the WKWebView pointer and disable magnification gestures
+ // This prevents Cmd+Ctrl+scroll and pinch-to-zoom from changing the zoom level
+ let wk_webview: Retained<WKWebView> =
+ Retained::retain(_webview.inner().cast()).unwrap();
+ wk_webview.setAllowsMagnification(false);
+ }
});
}
}