Skip to content

Commit

Permalink
Add Linux support for winit feature flag (#1024)
Browse files Browse the repository at this point in the history
* Add Linux support for winit feature flag

* Fix cargo config

* Revert default to tao

* Update CI to include winit linux

* Fix target
  • Loading branch information
wusyong authored Sep 11, 2023
1 parent 5adf9da commit c5c3731
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/winit-gtk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"wry": patch
---

Add winit-gtk to support winit feature flag on Linux.

1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:

- name: build wry with winit
if: (
contains(matrix.platform.target, 'gnu') ||
contains(matrix.platform.target, 'windows') ||
contains(matrix.platform.target, 'apple'))
run: cargo build --no-default-features --features winit --target ${{ matrix.platform.target }}
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ serde_json = "1.0"
thiserror = "1.0"
url = "2.4"
tao = { version = "0.22", default-features = false, features = [ "serde" ], optional = true }
winit = { version = "0.28", features = [ "serde" ], optional = true }
http = "0.2.9"

[dev-dependencies]
Expand All @@ -58,11 +57,13 @@ glib = "0.16"
gtk = "0.16"
gdk = "0.16"
soup3 = "0.3"
winit = { 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 }

[target."cfg(target_os = \"windows\")".dependencies.windows]
version = "0.48"
Expand Down Expand Up @@ -90,6 +91,7 @@ cocoa = "0.24"
core-graphics = "0.22"
objc = "0.2"
objc_id = "0.1"
winit = { version = "0.28", features = [ "serde" ], optional = true }

[target."cfg(target_os = \"android\")".dependencies]
crossbeam-channel = "0.5"
Expand Down
6 changes: 4 additions & 2 deletions src/webview/webkitgtk/file_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
use std::{cell::Cell, path::PathBuf, rc::Rc};

use gtk::prelude::*;
use tao::dpi::LogicalPosition;
use webkit2gtk::WebView;

use crate::{application::window::Window, webview::FileDropEvent};
use crate::{
application::{dpi::LogicalPosition, window::Window},
webview::FileDropEvent,
};

pub(crate) fn connect_drag_event(
webview: Rc<WebView>,
Expand Down

0 comments on commit c5c3731

Please sign in to comment.