Files
w0prup 3449f0def2 Wayland: trackpad pinch zooms the view (#7744) (#8023)
* claim: #7744

* Vendor winit 0.30.13 with Wayland touchpad pinch and rotation gestures

The 0.30 Wayland backend never binds zwp_pointer_gestures_v1, and
WindowEvent::PinchGesture / WindowEvent::RotationGesture only come from the
macOS and iOS backends, so a trackpad pinch produces no input at all on
Linux and Wayland (two-finger scroll still works, since X11/XWayland
reports it as a wheel). egui-winit already maps the events to
egui::Event::Zoom and navigation::handle already zooms the camera from
that, so the Wayland backend was the only missing piece.

Upstream the gesture support is part of winit 0.31 (rust-windowing/winit#4338),
which eframe 0.36 cannot use while it still requires winit 0.30, and the
0.30 backport rust-windowing/winit#4778 was closed unmerged. So ship the
same fix locally, upstream-style-applied and stripped of example and test
targets, with its unit tests for the gesture state machine kept under
cargo test -p winit --lib -- pointer_gesture:

- src/platform_impl/linux/wayland/seat/pointer/pointer_gesture.rs: bind
  the global (versions 1..=3), one pinch gesture object per pointer,
  destroyed before the pointer is released; begin/update/end become the
  two events for the window the gesture began over. Two fingers only;
  the protocol's scale is relative to the gesture's beginning, so the
  event carries the change since the previous update; rotation is
  negated to winit's counterclockwise degrees; a non-finite scale is
  dropped, and so are updates of a gesture whose begin we never saw.
- seat state wiring: bind the global, track and drop the gesture object.
- wayland-protocols' unstable feature, platform notes on both events,
  changelog, patch-section entry in Cargo.toml, vendor/README, and
  Linux/Wayland notes in the troubleshooting guide and the UI tour.

Retire this vendoring once an eframe release consumes winit 0.31 or
later; the cleaned branch is kept as
https://github.com/purp0w/winit/tree/wayland-pinch-gestures.

* ci: retrigger after flaky occurrence-cache test

---------

Co-authored-by: Francisco das Chagas Danta Filho <dev@dantas-filho.me>
2026-10-29 00:09:02 +00:00

494 lines
12 KiB
TOML

# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.70.0"
name = "winit"
version = "0.30.13"
authors = [
"The winit contributors",
"Pierre Krieger <pierre.krieger1708@gmail.com>",
]
build = "build.rs"
include = [
"/build.rs",
"/docs",
"/examples",
"/FEATURES.md",
"/LICENSE",
"/src",
"!/src/platform_impl/web/script",
"/src/platform_impl/web/script/**/*.min.js",
"/tests",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Cross-platform window creation library."
documentation = "https://docs.rs/winit"
readme = "README.md"
keywords = ["windowing"]
categories = ["gui"]
license = "Apache-2.0"
repository = "https://github.com/rust-windowing/winit"
[package.metadata.docs.rs]
features = [
"rwh_04",
"rwh_05",
"rwh_06",
"serde",
"mint",
"android-native-activity",
]
targets = [
"i686-pc-windows-msvc",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"i686-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
"x86_64-apple-ios",
"aarch64-linux-android",
"wasm32-unknown-unknown",
]
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
android-game-activity = ["android-activity/game-activity"]
android-native-activity = ["android-activity/native-activity"]
default = [
"rwh_06",
"x11",
"wayland",
"wayland-dlopen",
"wayland-csd-adwaita",
]
mint = ["dpi/mint"]
rwh_04 = [
"dep:rwh_04",
"ndk/rwh_04",
]
rwh_05 = [
"dep:rwh_05",
"ndk/rwh_05",
]
rwh_06 = [
"dep:rwh_06",
"ndk/rwh_06",
]
serde = [
"dep:serde",
"cursor-icon/serde",
"smol_str/serde",
"dpi/serde",
]
wayland = [
"wayland-client",
"wayland-backend",
"wayland-protocols",
"wayland-protocols-plasma",
"sctk",
"ahash",
"memmap2",
]
wayland-csd-adwaita = [
"sctk-adwaita",
"sctk-adwaita/ab_glyph",
]
wayland-csd-adwaita-crossfont = [
"sctk-adwaita",
"sctk-adwaita/crossfont",
]
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
wayland-dlopen = ["wayland-backend/dlopen"]
x11 = [
"x11-dl",
"bytemuck",
"percent-encoding",
"xkbcommon-dl/x11",
"x11rb",
]
[lib]
name = "winit"
path = "src/lib.rs"
# SolidCraft: example and test targets are dropped (their sources are not vendored).
[dependencies.bitflags]
version = "2"
[dependencies.cursor-icon]
version = "1.1.0"
[dependencies.dpi]
version = "0.1.1"
[dependencies.rwh_04]
version = "0.4"
optional = true
package = "raw-window-handle"
[dependencies.rwh_05]
version = "0.5.2"
features = ["std"]
optional = true
package = "raw-window-handle"
[dependencies.rwh_06]
version = "0.6"
features = ["std"]
optional = true
package = "raw-window-handle"
[dependencies.serde]
version = "1"
features = ["serde_derive"]
optional = true
[dependencies.smol_str]
version = "0.2.0"
[dependencies.tracing]
version = "0.1.40"
default-features = false
# SolidCraft: dev-dependencies are dropped along with the example and test targets
# (their sources are not vendored).
[build-dependencies.cfg_aliases]
version = "0.2.1"
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies.atomic-waker]
version = "1"
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies.concurrent-queue]
version = "2"
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.ahash]
version = "0.8.7"
features = ["no-rng"]
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.bytemuck]
version = "1.13.1"
optional = true
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.calloop]
version = "0.13.0"
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.libc]
version = "0.2.64"
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.memmap2]
version = "0.9.0"
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.percent-encoding]
version = "2.0"
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.rustix]
version = "0.38.4"
features = [
"std",
"system",
"thread",
"process",
]
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.sctk]
version = "0.19.2"
features = ["calloop"]
optional = true
default-features = false
package = "smithay-client-toolkit"
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.sctk-adwaita]
version = "0.10.1"
optional = true
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-backend]
version = "0.3.10"
features = ["client_system"]
optional = true
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-client]
version = "0.31.10"
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols]
version = "0.32.8"
# SolidCraft: also enable the unstable protocols, for the trackpad pinch
# and rotation gestures of `zwp_pointer_gestures_v1` (wayland/seat/pointer/pointer_gesture.rs).
features = ["staging", "unstable"]
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols-plasma]
version = "0.3.8"
features = ["client"]
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.x11-dl]
version = "2.19.1"
optional = true
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.x11rb]
version = "0.13.0"
features = [
"allow-unsafe-code",
"dl-libxcb",
"randr",
"resource_manager",
"xinput",
"xkb",
]
optional = true
default-features = false
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.xkbcommon-dl]
version = "0.4.2"
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.block2]
version = "0.5.1"
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.core-foundation]
version = "0.9.3"
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.objc2]
version = "0.5.2"
features = ["relax-sign-encoding"]
[target.'cfg(target_family = "wasm")'.dependencies.js-sys]
version = "0.3.70"
[target.'cfg(target_family = "wasm")'.dependencies.pin-project]
version = "1"
[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen]
version = "0.2.93"
[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen-futures]
version = "0.4.43"
[target.'cfg(target_family = "wasm")'.dependencies.web-time]
version = "1"
[target.'cfg(target_family = "wasm")'.dependencies.web_sys]
version = "0.3.70"
features = [
"AbortController",
"AbortSignal",
"Blob",
"BlobPropertyBag",
"console",
"CssStyleDeclaration",
"Document",
"DomException",
"DomRect",
"DomRectReadOnly",
"Element",
"Event",
"EventTarget",
"FocusEvent",
"HtmlCanvasElement",
"HtmlElement",
"HtmlImageElement",
"ImageBitmap",
"ImageBitmapOptions",
"ImageBitmapRenderingContext",
"ImageData",
"IntersectionObserver",
"IntersectionObserverEntry",
"KeyboardEvent",
"MediaQueryList",
"MessageChannel",
"MessagePort",
"Navigator",
"Node",
"OrientationLockType",
"OrientationType",
"PageTransitionEvent",
"Permissions",
"PermissionState",
"PermissionStatus",
"PointerEvent",
"PremultiplyAlpha",
"ResizeObserver",
"ResizeObserverBoxOptions",
"ResizeObserverEntry",
"ResizeObserverOptions",
"ResizeObserverSize",
"Screen",
"ScreenOrientation",
"Url",
"VisibilityState",
"WheelEvent",
"Window",
"Worker",
]
package = "web-sys"
[target.'cfg(target_os = "android")'.dependencies.android-activity]
version = "0.6.0"
[target.'cfg(target_os = "android")'.dependencies.ndk]
version = "0.9.0"
default-features = false
[target.'cfg(target_os = "ios")'.dependencies.objc2-foundation]
version = "0.2.2"
features = [
"block2",
"dispatch",
"NSArray",
"NSEnumerator",
"NSGeometry",
"NSObjCRuntime",
"NSOperation",
"NSString",
"NSProcessInfo",
"NSThread",
"NSSet",
]
[target.'cfg(target_os = "ios")'.dependencies.objc2-ui-kit]
version = "0.2.2"
features = [
"UIApplication",
"UIDevice",
"UIEvent",
"UIGeometry",
"UIGestureRecognizer",
"UITextInput",
"UITextInputTraits",
"UIOrientation",
"UIPanGestureRecognizer",
"UIPinchGestureRecognizer",
"UIResponder",
"UIRotationGestureRecognizer",
"UIScreen",
"UIScreenMode",
"UITapGestureRecognizer",
"UITouch",
"UITraitCollection",
"UIView",
"UIViewController",
"UIWindow",
]
[target.'cfg(target_os = "macos")'.dependencies.core-graphics]
version = "0.23.1"
[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit]
version = "0.2.2"
features = [
"NSAppearance",
"NSApplication",
"NSBitmapImageRep",
"NSButton",
"NSColor",
"NSControl",
"NSCursor",
"NSDragging",
"NSEvent",
"NSGraphics",
"NSGraphicsContext",
"NSImage",
"NSImageRep",
"NSMenu",
"NSMenuItem",
"NSOpenGLView",
"NSPasteboard",
"NSResponder",
"NSRunningApplication",
"NSScreen",
"NSTextInputClient",
"NSTextInputContext",
"NSView",
"NSWindow",
"NSWindowScripting",
"NSWindowTabGroup",
]
[target.'cfg(target_os = "macos")'.dependencies.objc2-foundation]
version = "0.2.2"
features = [
"block2",
"dispatch",
"NSArray",
"NSAttributedString",
"NSData",
"NSDictionary",
"NSDistributedNotificationCenter",
"NSEnumerator",
"NSKeyValueObserving",
"NSNotification",
"NSObjCRuntime",
"NSPathUtilities",
"NSProcessInfo",
"NSRunLoop",
"NSString",
"NSThread",
"NSValue",
]
[target.'cfg(target_os = "redox")'.dependencies.orbclient]
version = "0.3.47"
default-features = false
[target.'cfg(target_os = "redox")'.dependencies.redox_syscall]
version = "0.4.1"
[target.'cfg(target_os = "windows")'.dependencies.unicode-segmentation]
version = "1.7.1"
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.52.0"
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_Security",
"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",
]