diff --git a/Cargo.toml b/Cargo.toml index 7f11cbe899..4827c5da28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,6 @@ default = [ "file-drop", "objc-exception", "protocol", "tao" ] objc-exception = [ "objc/exception" ] file-drop = [ ] protocol = [ ] -dox = [ "tao/dox", "webkit2gtk/dox", "soup3/dox" ] devtools = [ ] transparent = [ ] fullscreen = [ ] @@ -41,7 +40,7 @@ serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" thiserror = "1.0" url = "2.4" -tao = { version = "0.22", default-features = false, features = [ "serde" ], optional = true } +tao = { version = "0.22", git = "https://github.com/dklassic/tao.git", branch = "gtk018", default-features = false, features = [ "serde" ], optional = true } http = "0.2.9" [dev-dependencies] @@ -49,21 +48,21 @@ http-range = "0.1.5" base64 = "0.21" [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -javascriptcore-rs = { version = "1.0", features = [ "v2_28" ] } -webkit2gtk = { version = "1.1", features = [ "v2_38" ] } -webkit2gtk-sys = "1.1" -gio = "0.16" -glib = "0.16" -gtk = "0.16" -gdk = "0.16" -soup3 = "0.3" -winit = { package = "winit-gtk", version = "0.28.1", features = [ "serde" ], optional = true } +javascriptcore-rs = { version = "=1.1", features = [ "v2_28" ] } +webkit2gtk = { version = "=2.0", features = [ "v2_38" ] } +webkit2gtk-sys = "=2.0" +gio = "0.18" +glib = "0.18" +gtk = "0.18" +gdk = "0.18" +soup3 = "0.5" +winit = { git = "https://github.com/dklassic/winit-gtk.git", branch = "gtk018" , package = "winit-gtk", version = "0.28.1", features = [ "serde" ], optional = true } [target."cfg(target_os = \"windows\")".dependencies] webview2-com = "0.25" windows-implement = "0.48" dunce = "1" -winit = { version = "0.28", features = [ "serde" ], optional = true } +winit = { git = "https://github.com/dklassic/winit-gtk.git", branch = "gtk018" , package = "winit-gtk", version = "0.28", features = [ "serde" ], optional = true } [target."cfg(target_os = \"windows\")".dependencies.windows] version = "0.48" @@ -91,7 +90,7 @@ cocoa = "0.24" core-graphics = "0.22" objc = "0.2" objc_id = "0.1" -winit = { version = "0.28", features = [ "serde" ], optional = true } +winit = { git = "https://github.com/dklassic/winit-gtk.git", branch = "gtk018" , package = "winit-gtk", version = "0.28", features = [ "serde" ], optional = true } [target."cfg(target_os = \"android\")".dependencies] crossbeam-channel = "0.5" diff --git a/src/webview/webkitgtk/file_drop.rs b/src/webview/webkitgtk/file_drop.rs index afa9633154..0d7547b703 100644 --- a/src/webview/webkitgtk/file_drop.rs +++ b/src/webview/webkitgtk/file_drop.rs @@ -82,6 +82,11 @@ pub(crate) fn connect_drag_event( // Called when a drag "fails" - we'll just emit a Cancelled event. let listener_ref = listener.clone(); let w = window; - webview - .connect_drag_failed(move |_, _, _| gtk::Inhibit(listener_ref.0(&w, FileDropEvent::Cancelled))); + webview.connect_drag_failed(move |_, _, _| { + if listener_ref.0(&w, FileDropEvent::Cancelled) { + glib::Propagation::Stop + } else { + glib::Propagation::Proceed + } + }); } diff --git a/src/webview/webkitgtk/mod.rs b/src/webview/webkitgtk/mod.rs index 0406f3e931..c4e3d60cff 100644 --- a/src/webview/webkitgtk/mod.rs +++ b/src/webview/webkitgtk/mod.rs @@ -15,9 +15,11 @@ use std::{ }; use url::Url; use webkit2gtk::{ - traits::*, AutoplayPolicy, LoadEvent, NavigationPolicyDecision, NetworkProxyMode, - NetworkProxySettings, PolicyDecisionType, SettingsExt, URIRequest, UserContentInjectedFrames, - UserScript, UserScriptInjectionTime, WebView, WebViewBuilder, WebsitePoliciesBuilder, + AutoplayPolicy, InputMethodContextExt, LoadEvent, NavigationPolicyDecision, + NavigationPolicyDecisionExt, NetworkProxyMode, NetworkProxySettings, PolicyDecisionType, + SettingsExt, URIRequest, URIRequestExt, UserContentInjectedFrames, UserContentManagerExt, + UserScript, UserScriptInjectionTime, WebInspectorExt, WebView, WebViewExt, WebsiteDataManagerExt, + WebsitePolicies, }; use webkit2gtk_sys::{ webkit_get_major_version, webkit_get_micro_version, webkit_get_minor_version, @@ -86,13 +88,13 @@ impl InnerWebView { } } let webview = { - let mut webview = WebViewBuilder::new(); + let mut webview = WebView::builder(); webview = webview.user_content_manager(web_context.manager()); webview = webview.web_context(web_context.context()); webview = webview.is_controlled_by_automation(web_context.allows_automation()); if attributes.autoplay { webview = webview.website_policies( - &WebsitePoliciesBuilder::new() + &WebsitePolicies::builder() .autoplay(AutoplayPolicy::Allow) .build(), ); diff --git a/src/webview/webkitgtk/synthetic_mouse_events.rs b/src/webview/webkitgtk/synthetic_mouse_events.rs index 31c1f59ebc..2efe58cb47 100644 --- a/src/webview/webkitgtk/synthetic_mouse_events.rs +++ b/src/webview/webkitgtk/synthetic_mouse_events.rs @@ -34,7 +34,11 @@ pub fn setup(webview: &WebView) { _ => {} } - Inhibit(inhibit) + if inhibit { + glib::Propagation::Stop + } else { + glib::Propagation::Proceed + } }); let bf_state_c = bf_state.clone(); @@ -63,7 +67,11 @@ pub fn setup(webview: &WebView) { } _ => {} } - Inhibit(inhibit) + if inhibit { + glib::Propagation::Stop + } else { + glib::Propagation::Proceed + } }); } diff --git a/src/webview/webkitgtk/undecorated_resizing.rs b/src/webview/webkitgtk/undecorated_resizing.rs index c6fa8601fb..d1ed4dee98 100644 --- a/src/webview/webkitgtk/undecorated_resizing.rs +++ b/src/webview/webkitgtk/undecorated_resizing.rs @@ -37,7 +37,7 @@ pub fn setup(webview: &WebView) { } } } - Inhibit(false) + glib::Propagation::Proceed }); webview.connect_button_press_event(move |webview, event| { let inhibit = false; @@ -64,7 +64,11 @@ pub fn setup(webview: &WebView) { } } } - Inhibit(inhibit) + if inhibit { + glib::Propagation::Stop + } else { + glib::Propagation::Proceed + } }); webview.connect_touch_event(|webview, event| { // This one should be GtkBox @@ -97,6 +101,6 @@ pub fn setup(webview: &WebView) { } } } - Inhibit(false) + glib::Propagation::Proceed }); } diff --git a/src/webview/webkitgtk/web_context.rs b/src/webview/webkitgtk/web_context.rs index e9f3abaf55..cd0b3c5e06 100644 --- a/src/webview/webkitgtk/web_context.rs +++ b/src/webview/webkitgtk/web_context.rs @@ -24,8 +24,8 @@ use std::{ }; use url::Url; use webkit2gtk::{ - traits::*, ApplicationInfo, CookiePersistentStorage, LoadEvent, URIRequest, UserContentManager, - WebContext, WebContextBuilder, WebView, WebsiteDataManagerBuilder, + ApplicationInfo, CookiePersistentStorage, LoadEvent, URIRequest, URIRequestExt, + URISchemeResponseExt, UserContentManager, WebContext, WebView, WebViewExt, }; #[derive(Debug)] @@ -40,12 +40,13 @@ pub struct WebContextImpl { impl WebContextImpl { pub fn new(data: &WebContextData) -> Self { - let mut context_builder = WebContextBuilder::new(); + use webkit2gtk::{CookieManagerExt, WebsiteDataManager, WebsiteDataManagerExt}; + let mut context_builder = WebContext::builder(); if let Some(data_directory) = data.data_directory() { - let data_manager = WebsiteDataManagerBuilder::new() - .local_storage_directory(&data_directory.join("localstorage").to_string_lossy()) + let data_manager = WebsiteDataManager::builder() + .local_storage_directory(data_directory.join("localstorage").to_string_lossy()) .indexeddb_directory( - &data_directory + data_directory .join("databases") .join("indexeddb") .to_string_lossy(), @@ -71,7 +72,7 @@ impl WebContextImpl { } pub fn create_context(context: WebContext) -> Self { - use webkit2gtk::traits::*; + use webkit2gtk::WebContextExt; let automation = false; context.set_automation_allowed(automation); @@ -101,7 +102,7 @@ impl WebContextImpl { } pub fn set_allows_automation(&mut self, flag: bool) { - use webkit2gtk::traits::*; + use webkit2gtk::WebContextExt; self.automation = flag; self.context.set_automation_allowed(flag); } @@ -201,7 +202,7 @@ impl WebContextExt for super::WebContext { } fn register_automation(&mut self, webview: WebView) { - use webkit2gtk::traits::*; + use webkit2gtk::{AutomationSessionExt, WebContextExt}; if let (true, Some(app_info)) = (self.os.automation, self.os.app_info.take()) { self.os.context.connect_automation_started(move |_, auto| { @@ -225,7 +226,7 @@ impl WebContextExt for super::WebContext { download_started_handler: Option bool>>, download_completed_handler: Option, bool) + 'static>>, ) { - use webkit2gtk::traits::*; + use webkit2gtk::{DownloadExt, WebContextExt}; let context = &self.os.context; let download_started_handler = RefCell::new(download_started_handler); @@ -289,7 +290,7 @@ fn actually_register_uri_scheme( where F: Fn(Request>, RequestAsyncResponder) + 'static, { - use webkit2gtk::traits::*; + use webkit2gtk::{SecurityManagerExt, URISchemeRequestExt, WebContextExt}; let context = &context.os.context; // Enable secure context context @@ -393,7 +394,7 @@ where for (name, value) in http_response.headers().into_iter() { headers.append(name.as_str(), value.to_str().unwrap_or("")); } - response.set_http_headers(&headers); + response.set_http_headers(headers); request_.finish_with_response(&response); });