Vendor opencode source for docker build

This commit is contained in:
southseact-3d
2026-02-07 20:54:46 +00:00
parent b30ff1cfa4
commit efda260214
3195 changed files with 387717 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
use tauri::{Manager, Runtime, Window, plugin::Plugin};
pub struct PinchZoomDisablePlugin;
impl Default for PinchZoomDisablePlugin {
fn default() -> Self {
Self
}
}
impl<R: Runtime> Plugin<R> for PinchZoomDisablePlugin {
fn name(&self) -> &'static str {
"Does not matter here"
}
fn window_created(&mut self, window: Window<R>) {
let Some(webview_window) = window.get_webview_window(window.label()) else {
return;
};
let _ = webview_window.with_webview(|_webview| {
#[cfg(target_os = "linux")]
unsafe {
use gtk::GestureZoom;
use gtk::glib::ObjectExt;
use webkit2gtk::glib::gobject_ffi;
if let Some(data) = _webview.inner().data::<GestureZoom>("wk-view-zoom-gesture") {
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);
}
});
}
}