mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
05484c5888
This updates the Android backend to use the android-activity crate instead of ndk-glue. This solves a few issues: 1. The backend is agnostic of the application's choice of Activity base class 2. Winit is no longer responsible for handling any Java synchronization details, since these are encapsulated by the design of android_activity 3. The backend no longer depends on global / static getters for state such as the native_window() which puts it in a better position to support running multiple activities within a single Android process. 4. Redraw requests are flagged, not queued, in a way that avoids taking priority over user events (resolves #2299) To make it possible for application crates to avoid explicitly depending on the `android-activity` crate (and avoid version conflicts) this re-exports the android-activity crate under: `winit::platform::android::activity::*` This also adds `android-native-activity` and `android-game-activity` features that set the corresponding android-activity features. Addresses: PR https://github.com/rust-windowing/winit/pull/1892 Addresses: PR https://github.com/rust-windowing/winit/pull/2307 Addresses: PR https://github.com/rust-windowing/winit/pull/2343 Addresses: #2293 Resolves: #2299 Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com> Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
151 lines
4.7 KiB
TOML
151 lines
4.7 KiB
TOML
[package]
|
|
name = "winit"
|
|
version = "0.27.5"
|
|
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
|
description = "Cross-platform window creation library."
|
|
edition = "2021"
|
|
keywords = ["windowing"]
|
|
license = "Apache-2.0"
|
|
readme = "README.md"
|
|
repository = "https://github.com/rust-windowing/winit"
|
|
documentation = "https://docs.rs/winit"
|
|
categories = ["gui"]
|
|
rust-version = "1.60.0"
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["serde"]
|
|
default-target = "x86_64-unknown-linux-gnu"
|
|
# These are all tested in CI
|
|
targets = [
|
|
# Windows
|
|
"i686-pc-windows-msvc",
|
|
"x86_64-pc-windows-msvc",
|
|
# macOS
|
|
"x86_64-apple-darwin",
|
|
# Unix (X11 & Wayland)
|
|
"i686-unknown-linux-gnu",
|
|
"x86_64-unknown-linux-gnu",
|
|
# iOS
|
|
"x86_64-apple-ios",
|
|
# Android
|
|
"aarch64-linux-android",
|
|
# WebAssembly
|
|
"wasm32-unknown-unknown",
|
|
]
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
[features]
|
|
default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
|
|
x11 = ["x11-dl", "mio", "percent-encoding"]
|
|
wayland = ["wayland-client", "wayland-protocols", "sctk"]
|
|
wayland-dlopen = ["sctk/dlopen", "wayland-client/dlopen"]
|
|
wayland-csd-adwaita = ["sctk-adwaita", "sctk-adwaita/ab_glyph"]
|
|
wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"]
|
|
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
|
|
android-native-activity = [ "android-activity/native-activity" ]
|
|
android-game-activity = [ "android-activity/game-activity" ]
|
|
|
|
[dependencies]
|
|
instant = { version = "0.1", features = ["wasm-bindgen"] }
|
|
once_cell = "1.12"
|
|
log = "0.4"
|
|
serde = { version = "1", optional = true, features = ["serde_derive"] }
|
|
raw_window_handle = { package = "raw-window-handle", version = "0.5" }
|
|
raw_window_handle_04 = { package = "raw-window-handle", version = "0.4.3" }
|
|
bitflags = "1"
|
|
mint = { version = "0.5.6", optional = true }
|
|
|
|
[dev-dependencies]
|
|
image = { version = "0.24.0", default-features = false, features = ["png"] }
|
|
simple_logger = { version = "2.1.0", default_features = false }
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
# Coordinate the next winit release with android-ndk-rs: https://github.com/rust-windowing/winit/issues/1995
|
|
ndk = "0.7.0"
|
|
android-activity = "0.4.0-beta.1"
|
|
|
|
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
|
|
objc2 = "=0.3.0-beta.3"
|
|
core-foundation = "0.9.3"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
core-graphics = "0.22.3"
|
|
dispatch = "0.2.0"
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
|
|
version = "0.42"
|
|
features = [
|
|
"Win32_Devices_HumanInterfaceDevice",
|
|
"Win32_Foundation",
|
|
"Win32_Globalization",
|
|
"Win32_Graphics_Dwm",
|
|
"Win32_Graphics_Gdi",
|
|
"Win32_Media",
|
|
"Win32_System_Com_StructuredStorage",
|
|
"Win32_System_Com",
|
|
"Win32_System_LibraryLoader",
|
|
"Win32_System_Ole",
|
|
"Win32_System_SystemInformation",
|
|
"Win32_System_SystemServices",
|
|
"Win32_System_Threading",
|
|
"Win32_System_WindowsProgramming",
|
|
"Win32_UI_Accessibility",
|
|
"Win32_UI_Controls",
|
|
"Win32_UI_HiDpi",
|
|
"Win32_UI_Input_Ime",
|
|
"Win32_UI_Input_KeyboardAndMouse",
|
|
"Win32_UI_Input_Pointer",
|
|
"Win32_UI_Input_Touch",
|
|
"Win32_UI_Shell",
|
|
"Win32_UI_TextServices",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
]
|
|
|
|
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
|
|
wayland-client = { version = "0.29.4", default_features = false, features = ["use_system_lib"], optional = true }
|
|
wayland-protocols = { version = "0.29.4", features = [ "staging_protocols"], optional = true }
|
|
sctk = { package = "smithay-client-toolkit", version = "0.16.0", default_features = false, features = ["calloop"], optional = true }
|
|
sctk-adwaita = { version = "0.5.1", default_features = false, optional = true }
|
|
mio = { version = "0.8", features = ["os-ext"], optional = true }
|
|
x11-dl = { version = "2.18.5", optional = true }
|
|
percent-encoding = { version = "2.0", optional = true }
|
|
libc = "0.2.64"
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies.web_sys]
|
|
package = "web-sys"
|
|
version = "0.3.22"
|
|
features = [
|
|
'console',
|
|
"AddEventListenerOptions",
|
|
'CssStyleDeclaration',
|
|
'BeforeUnloadEvent',
|
|
'Document',
|
|
'DomRect',
|
|
'Element',
|
|
'Event',
|
|
'EventTarget',
|
|
'FocusEvent',
|
|
'HtmlCanvasElement',
|
|
'HtmlElement',
|
|
'KeyboardEvent',
|
|
'MediaQueryList',
|
|
'MediaQueryListEvent',
|
|
'MouseEvent',
|
|
'Node',
|
|
'PointerEvent',
|
|
'Window',
|
|
'WheelEvent'
|
|
]
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen]
|
|
version = "0.2.45"
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
|
console_log = "0.2"
|
|
web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] }
|
|
|
|
[workspace]
|
|
members = [
|
|
"run-wasm",
|
|
]
|