mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 21:19:48 +00:00
fix(desktop): disable magnification gestures on macOS (#10605)
This commit is contained in:
parent
7655f51e10
commit
d9e8b2b65d
3 changed files with 18 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue