Skip to content

Commit c5c3731

Browse files
authored
Add Linux support for winit feature flag (tauri-apps#1024)
* Add Linux support for winit feature flag * Fix cargo config * Revert default to tao * Update CI to include winit linux * Fix target
1 parent 5adf9da commit c5c3731

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.changes/winit-gtk.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"wry": patch
3+
---
4+
5+
Add winit-gtk to support winit feature flag on Linux.
6+

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757

5858
- name: build wry with winit
5959
if: (
60+
contains(matrix.platform.target, 'gnu') ||
6061
contains(matrix.platform.target, 'windows') ||
6162
contains(matrix.platform.target, 'apple'))
6263
run: cargo build --no-default-features --features winit --target ${{ matrix.platform.target }}

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ serde_json = "1.0"
4242
thiserror = "1.0"
4343
url = "2.4"
4444
tao = { version = "0.22", default-features = false, features = [ "serde" ], optional = true }
45-
winit = { version = "0.28", features = [ "serde" ], optional = true }
4645
http = "0.2.9"
4746

4847
[dev-dependencies]
@@ -58,11 +57,13 @@ glib = "0.16"
5857
gtk = "0.16"
5958
gdk = "0.16"
6059
soup3 = "0.3"
60+
winit = { package = "winit-gtk", version = "0.28.1", features = [ "serde" ], optional = true }
6161

6262
[target."cfg(target_os = \"windows\")".dependencies]
6363
webview2-com = "0.25"
6464
windows-implement = "0.48"
6565
dunce = "1"
66+
winit = { version = "0.28", features = [ "serde" ], optional = true }
6667

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

9496
[target."cfg(target_os = \"android\")".dependencies]
9597
crossbeam-channel = "0.5"

src/webview/webkitgtk/file_drop.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
use std::{cell::Cell, path::PathBuf, rc::Rc};
66

77
use gtk::prelude::*;
8-
use tao::dpi::LogicalPosition;
98
use webkit2gtk::WebView;
109

11-
use crate::{application::window::Window, webview::FileDropEvent};
10+
use crate::{
11+
application::{dpi::LogicalPosition, window::Window},
12+
webview::FileDropEvent,
13+
};
1214

1315
pub(crate) fn connect_drag_event(
1416
webview: Rc<WebView>,

0 commit comments

Comments
 (0)