diff --git a/Cargo.lock b/Cargo.lock index 21192f1e..708e36b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -282,20 +282,20 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "block2" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" dependencies = [ - "objc2 0.5.2", + "objc2", ] [[package]] -name = "block2" -version = "0.6.2" +name = "borsh" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" dependencies = [ - "objc2 0.6.3", + "cfg_aliases", ] [[package]] @@ -338,26 +338,25 @@ checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "calloop" -version = "0.13.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e" dependencies = [ "bitflags 2.10.0", - "log", "polling", - "rustix 0.38.44", + "rustix", "slab", - "thiserror 1.0.69", + "tracing", ] [[package]] name = "calloop-wayland-source" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" dependencies = [ "calloop", - "rustix 0.38.44", + "rustix", "wayland-backend", "wayland-client", ] @@ -500,30 +499,6 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "core-graphics" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "core-graphics-types 0.1.3", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "libc", -] - [[package]] name = "core-graphics-types" version = "0.2.0" @@ -594,7 +569,7 @@ dependencies = [ "rustc-hash 1.1.0", "self_cell", "skrifa", - "smol_str", + "smol_str 0.2.2", "swash", "sys-locale", "unicode-bidi", @@ -620,13 +595,13 @@ dependencies = [ "ndk-context", "num-derive", "num-traits", - "objc2 0.6.3", + "objc2", "objc2-audio-toolbox", "objc2-avf-audio", "objc2-core-audio", "objc2-core-audio-types", "objc2-core-foundation", - "objc2-foundation 0.3.2", + "objc2-foundation", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -694,12 +669,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - [[package]] name = "dispatch2" version = "0.3.0" @@ -707,9 +676,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ "bitflags 2.10.0", - "block2 0.6.2", + "block2", "libc", - "objc2 0.6.3", + "objc2", ] [[package]] @@ -1044,7 +1013,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" dependencies = [ - "rustix 1.1.3", + "rustix", "windows-link", ] @@ -1284,6 +1253,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.10.0", + "serde", +] + [[package]] name = "khronos-egl" version = "6.0.0" @@ -1355,12 +1334,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -1451,7 +1424,7 @@ checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" dependencies = [ "bitflags 2.10.0", "block", - "core-graphics-types 0.2.0", + "core-graphics-types", "foreign-types", "log", "objc", @@ -1773,22 +1746,6 @@ dependencies = [ "malloc_buf", ] -[[package]] -name = "objc-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" - -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys", - "objc2-encode", -] - [[package]] name = "objc2" version = "0.6.3" @@ -1798,22 +1755,6 @@ dependencies = [ "objc2-encode", ] -[[package]] -name = "objc2-app-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "libc", - "objc2 0.5.2", - "objc2-core-data", - "objc2-core-image", - "objc2-foundation 0.2.2", - "objc2-quartz-core", -] - [[package]] name = "objc2-app-kit" version = "0.3.2" @@ -1821,9 +1762,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ "bitflags 2.10.0", - "block2 0.6.2", - "objc2 0.6.3", - "objc2-foundation 0.3.2", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", ] [[package]] @@ -1834,11 +1776,11 @@ checksum = "6948501a91121d6399b79abaa33a8aa4ea7857fe019f341b8c23ad6e81b79b08" dependencies = [ "bitflags 2.10.0", "libc", - "objc2 0.6.3", + "objc2", "objc2-core-audio", "objc2-core-audio-types", "objc2-core-foundation", - "objc2-foundation 0.3.2", + "objc2-foundation", ] [[package]] @@ -1847,32 +1789,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13a380031deed8e99db00065c45937da434ca987c034e13b87e4441f9e4090be" dependencies = [ - "objc2 0.6.3", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-contacts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "objc2", + "objc2-foundation", ] [[package]] @@ -1882,10 +1800,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1eebcea8b0dbff5f7c8504f3107c68fc061a3eb44932051c8cf8a68d969c3b2" dependencies = [ "dispatch2", - "objc2 0.6.3", + "objc2", "objc2-core-audio-types", "objc2-core-foundation", - "objc2-foundation 0.3.2", + "objc2-foundation", ] [[package]] @@ -1895,19 +1813,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a89f2ec274a0cf4a32642b2991e8b351a404d290da87bb6a9a9d8632490bd1c" dependencies = [ "bitflags 2.10.0", - "objc2 0.6.3", -] - -[[package]] -name = "objc2-core-data" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "objc2", ] [[package]] @@ -1917,34 +1823,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.10.0", - "block2 0.6.2", + "block2", "dispatch2", "libc", - "objc2 0.6.3", + "objc2", ] [[package]] -name = "objc2-core-image" -version = "0.2.2" +name = "objc2-core-graphics" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", - "objc2-metal", + "bitflags 2.10.0", + "libc", + "objc2-core-foundation", ] [[package]] -name = "objc2-core-location" -version = "0.2.2" +name = "objc2-core-video" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-contacts", - "objc2-foundation 0.2.2", + "bitflags 2.10.0", + "objc2-core-foundation", + "objc2-core-graphics", ] [[package]] @@ -1953,19 +1857,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "dispatch", - "libc", - "objc2 0.5.2", -] - [[package]] name = "objc2-foundation" version = "0.3.2" @@ -1973,102 +1864,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.10.0", - "block2 0.6.2", + "block2", "libc", - "objc2 0.6.3", + "objc2", "objc2-core-foundation", ] -[[package]] -name = "objc2-link-presentation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-metal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", - "objc2-metal", -] - -[[package]] -name = "objc2-symbols" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" -dependencies = [ - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - [[package]] name = "objc2-ui-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" -dependencies = [ - "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-image", - "objc2-core-location", - "objc2-foundation 0.2.2", - "objc2-link-presentation", - "objc2-quartz-core", - "objc2-symbols", - "objc2-uniform-type-identifiers", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-uniform-type-identifiers" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ "bitflags 2.10.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation 0.2.2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", ] [[package]] @@ -2239,7 +2050,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.3", + "rustix", "windows-sys 0.61.2", ] @@ -2435,15 +2246,6 @@ dependencies = [ "rustfft", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.18" @@ -2503,13 +2305,13 @@ version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220" dependencies = [ - "block2 0.6.2", + "block2", "dispatch2", "js-sys", "libc", "log", - "objc2 0.6.3", - "objc2-app-kit 0.3.2", + "objc2", + "objc2-app-kit", "objc2-core-foundation", "objc2-foundation 0.3.2", "percent-encoding", @@ -2689,19 +2491,6 @@ dependencies = [ "transpose", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.10.0", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.3" @@ -2711,7 +2500,7 @@ dependencies = [ "bitflags 2.10.0", "errno", "libc", - "linux-raw-sys 0.11.0", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -2744,9 +2533,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +checksum = "1dd3accc0f3f4bbaf2c9e1957a030dc582028130c67660d44c0a0345a22ca69b" dependencies = [ "ab_glyph", "log", @@ -2864,9 +2653,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smithay-client-toolkit" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0" dependencies = [ "bitflags 2.10.0", "calloop", @@ -2875,13 +2664,15 @@ dependencies = [ "libc", "log", "memmap2", - "rustix 0.38.44", - "thiserror 1.0.69", + "rustix", + "thiserror 2.0.17", "wayland-backend", "wayland-client", "wayland-csd-frame", "wayland-cursor", "wayland-protocols", + "wayland-protocols-experimental", + "wayland-protocols-misc", "wayland-protocols-wlr", "wayland-scanner", "xkeysym", @@ -2892,8 +2683,15 @@ name = "smol_str" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" + +[[package]] +name = "smol_str" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3498b0a27f93ef1402f20eefacfaa1691272ac4eca1cdc8c596cb0a245d6cbf5" dependencies = [ - "serde", + "borsh", + "serde_core", ] [[package]] @@ -3271,6 +3069,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ + "log", "pin-project-lite", "tracing-core", ] @@ -3466,7 +3265,7 @@ checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.3", + "rustix", "scoped-tls", "smallvec", "wayland-sys", @@ -3479,7 +3278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" dependencies = [ "bitflags 2.10.0", - "rustix 1.1.3", + "rustix", "wayland-backend", "wayland-scanner", ] @@ -3501,7 +3300,7 @@ version = "0.31.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" dependencies = [ - "rustix 1.1.3", + "rustix", "wayland-client", "xcursor", ] @@ -3518,6 +3317,32 @@ dependencies = [ "wayland-scanner", ] +[[package]] +name = "wayland-protocols-experimental" +version = "20250721.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-misc" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + [[package]] name = "wayland-protocols-plasma" version = "0.3.10" @@ -3691,7 +3516,7 @@ dependencies = [ "bytemuck", "cfg-if", "cfg_aliases", - "core-graphics-types 0.2.0", + "core-graphics-types", "glow", "glutin_wgl_sys", "gpu-allocator", @@ -3919,15 +3744,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -4078,51 +3894,224 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.30.12" +version = "0.31.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66d4b9ed69c4009f6321f762d6e61ad8a2389cd431b97cb1e146812e9e6c732" +checksum = "2879d2854d1a43e48f67322d4bd097afcb6eb8f8f775c8de0260a71aea1df1aa" dependencies = [ - "ahash", - "android-activity", - "atomic-waker", "bitflags 2.10.0", - "block2 0.5.1", - "bytemuck", - "calloop", "cfg_aliases", - "concurrent-queue", - "core-foundation 0.9.4", - "core-graphics", "cursor-icon", "dpi", - "js-sys", "libc", - "memmap2", + "raw-window-handle", + "rustix", + "smol_str 0.3.4", + "tracing", + "winit-android", + "winit-appkit", + "winit-common", + "winit-core", + "winit-orbital", + "winit-uikit", + "winit-wayland", + "winit-web", + "winit-win32", + "winit-x11", +] + +[[package]] +name = "winit-android" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d9c0d2cd93efec3a9f9ad819cfaf0834782403af7c0d248c784ec0c61761df" +dependencies = [ + "android-activity", + "bitflags 2.10.0", + "dpi", "ndk", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", - "objc2-ui-kit", + "raw-window-handle", + "smol_str 0.3.4", + "tracing", + "winit-core", +] + +[[package]] +name = "winit-appkit" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21310ca07851a49c348e0c2cc768e36b52ca65afda2c2354d78ed4b90074d8aa" +dependencies = [ + "bitflags 2.10.0", + "block2", + "dispatch2", + "dpi", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-video", + "objc2-foundation", + "raw-window-handle", + "smol_str 0.3.4", + "tracing", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-common" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45375fbac4cbb77260d83a30b1f9d8105880dbac99a9ae97f56656694680ff69" +dependencies = [ + "memmap2", + "objc2", + "objc2-core-foundation", + "smol_str 0.3.4", + "tracing", + "winit-core", + "x11-dl", + "xkbcommon-dl", +] + +[[package]] +name = "winit-core" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4f0ccd7abb43740e2c6124ac7cae7d865ecec74eec63783e8922577ac232583" +dependencies = [ + "bitflags 2.10.0", + "cursor-icon", + "dpi", + "keyboard-types", + "raw-window-handle", + "smol_str 0.3.4", + "web-time", +] + +[[package]] +name = "winit-orbital" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ea1fb262e7209f265f12bd0cc792c399b14355675e65531e9c8a87db287d46" +dependencies = [ + "bitflags 2.10.0", + "dpi", "orbclient", - "percent-encoding", - "pin-project", "raw-window-handle", - "redox_syscall 0.4.1", - "rustix 0.38.44", + "redox_syscall 0.5.18", + "smol_str 0.3.4", + "tracing", + "winit-core", +] + +[[package]] +name = "winit-uikit" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680a356e798837d8eb274d4556e83bceaf81698194e31aafc5cfb8a9f2fab643" +dependencies = [ + "bitflags 2.10.0", + "block2", + "dispatch2", + "dpi", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "raw-window-handle", + "smol_str 0.3.4", + "tracing", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-wayland" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce5afb2ba07da603f84b722c95f9f9396d2cedae3944fb6c0cda4a6f88de545" +dependencies = [ + "ahash", + "bitflags 2.10.0", + "calloop", + "cursor-icon", + "dpi", + "libc", + "memmap2", + "raw-window-handle", + "rustix", "sctk-adwaita", "smithay-client-toolkit", - "smol_str", + "smol_str 0.3.4", "tracing", - "unicode-segmentation", - "wasm-bindgen", - "wasm-bindgen-futures", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-protocols-plasma", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-web" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2490a953fb776fbbd5e295d54f1c3847f4f15b6c3929ec53c09acda6487a92" +dependencies = [ + "atomic-waker", + "bitflags 2.10.0", + "concurrent-queue", + "cursor-icon", + "dpi", + "js-sys", + "pin-project", + "raw-window-handle", + "smol_str 0.3.4", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", "web-sys", "web-time", - "windows-sys 0.52.0", + "winit-core", +] + +[[package]] +name = "winit-win32" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644ea78af0e858aa3b092e5d1c67c41995a98220c81813f1353b28bc8bb91eaa" +dependencies = [ + "bitflags 2.10.0", + "cursor-icon", + "dpi", + "raw-window-handle", + "smol_str 0.3.4", + "tracing", + "unicode-segmentation", + "windows-sys 0.59.0", + "winit-core", +] + +[[package]] +name = "winit-x11" +version = "0.31.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa5b600756534c7041aa93cd0d244d44b09fca1b89e202bd1cd80dd9f3636c46" +dependencies = [ + "bitflags 2.10.0", + "bytemuck", + "calloop", + "cursor-icon", + "dpi", + "libc", + "percent-encoding", + "raw-window-handle", + "rustix", + "smol_str 0.3.4", + "tracing", + "winit-common", + "winit-core", "x11-dl", "x11rb", "xkbcommon-dl", @@ -4175,8 +4164,9 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.1.3", + "rustix", "x11rb-protocol", + "xcursor", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 393607f8..7fcdb659 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ futures-channel = "0.3" euclid = "0.22" lilt = "0.8" -winit = "0.30" +winit = "0.31.0-beta.2" dpi = "0.1" rfd = "0.17" cpal = "0.17" diff --git a/neothesia/src/context.rs b/neothesia/src/context.rs index fb770195..a748be4b 100644 --- a/neothesia/src/context.rs +++ b/neothesia/src/context.rs @@ -6,12 +6,37 @@ use crate::{ }; use neothesia_core::render::{QuadRendererFactory, TextRendererFactory}; use wgpu_jumpstart::{Gpu, Uniform}; -use winit::event_loop::EventLoopProxy; use winit::window::Window; +#[derive(Clone)] +pub struct EventLoopProxy { + proxy: winit::event_loop::EventLoopProxy, + tx: std::sync::mpsc::Sender, +} + +impl EventLoopProxy { + pub fn new( + proxy: winit::event_loop::EventLoopProxy, + ) -> (Self, std::sync::mpsc::Receiver) { + let (tx, rx) = std::sync::mpsc::channel(); + + (Self { proxy, tx }, rx) + } + + pub fn send_event(&self, event: NeothesiaEvent) -> Result<(), ()> { + if let Err(err) = self.tx.send(event) { + log::error!("winit event send: {err}"); + // TODO: Drop this once winit 0.31 is stable and merge conflits are no longer a concern + return Err(()); + } + self.proxy.wake_up(); + Ok(()) + } +} + pub struct Context { - pub window: Arc, + pub window: Arc, pub window_state: WindowState, pub gpu: Gpu, @@ -24,7 +49,7 @@ pub struct Context { pub input_manager: InputManager, pub config: Config, - pub proxy: EventLoopProxy, + pub proxy: EventLoopProxy, /// Last frame timestamp pub frame_timestamp: std::time::Instant, @@ -41,9 +66,9 @@ impl Drop for Context { impl Context { pub fn new( - window: Arc, + window: Arc, window_state: WindowState, - proxy: EventLoopProxy, + proxy: EventLoopProxy, gpu: Gpu, ) -> Self { let transform_uniform = Uniform::new( diff --git a/neothesia/src/input_manager/mod.rs b/neothesia/src/input_manager/mod.rs index 8afe213a..4c4bb0db 100644 --- a/neothesia/src/input_manager/mod.rs +++ b/neothesia/src/input_manager/mod.rs @@ -1,16 +1,15 @@ use midi_file::midly::{self, MidiMessage, live::LiveEvent}; -use winit::event_loop::EventLoopProxy; -use crate::NeothesiaEvent; +use crate::{NeothesiaEvent, context::EventLoopProxy}; pub struct InputManager { input: midi_io::MidiInputManager, - tx: EventLoopProxy, + tx: EventLoopProxy, current_connection: Option, } impl InputManager { - pub fn new(tx: EventLoopProxy) -> Self { + pub fn new(tx: EventLoopProxy) -> Self { let input = midi_io::MidiInputManager::new().unwrap(); Self { input, diff --git a/neothesia/src/main.rs b/neothesia/src/main.rs index 384292c1..2c8f09e3 100644 --- a/neothesia/src/main.rs +++ b/neothesia/src/main.rs @@ -20,12 +20,13 @@ use neothesia_core::{config, render}; use wgpu_jumpstart::{Gpu, Surface, TransformUniform}; use winit::{ application::ApplicationHandler, - event::{ElementState, MouseButton, TouchPhase, WindowEvent}, - event_loop::{EventLoop, EventLoopProxy}, + event::{ButtonSource, ElementState, MouseButton, PointerSource, WindowEvent}, + event_loop::EventLoop, keyboard::NamedKey, + window::{Window, WindowAttributes}, }; -use crate::utils::window::WinitEvent; +use crate::{context::EventLoopProxy, utils::window::WinitEvent}; #[derive(Debug)] pub enum NeothesiaEvent { @@ -67,7 +68,7 @@ impl Neothesia { fn window_event( &mut self, - event_loop: &winit::event_loop::ActiveEventLoop, + event_loop: &dyn winit::event_loop::ActiveEventLoop, _window_id: winit::window::WindowId, event: &WindowEvent, ) { @@ -75,7 +76,7 @@ impl Neothesia { match event { // Windows sets size to 0 on minimise - WindowEvent::Resized(ps) if ps.width > 0 && ps.height > 0 => { + WindowEvent::SurfaceResized(ps) if ps.width > 0 && ps.height > 0 => { self.surface.resize_swap_chain( &self.context.gpu.device, self.context.window_state.physical_size.width, @@ -101,10 +102,10 @@ impl Neothesia { } else { let monitor = self.context.window.current_monitor(); if let Some(monitor) = monitor { - let f = winit::window::Fullscreen::Borderless(Some(monitor)); + let f = winit::monitor::Fullscreen::Borderless(Some(monitor)); self.context.window.set_fullscreen(Some(f)); } else { - let f = winit::window::Fullscreen::Borderless(None); + let f = winit::monitor::Fullscreen::Borderless(None); self.context.window.set_fullscreen(Some(f)); } } @@ -132,7 +133,7 @@ impl Neothesia { fn user_event( &mut self, - event_loop: &winit::event_loop::ActiveEventLoop, + event_loop: &dyn winit::event_loop::ActiveEventLoop, event: NeothesiaEvent, ) { match event { @@ -158,7 +159,7 @@ impl Neothesia { } } - fn about_to_wait(&mut self, _event_loop: &winit::event_loop::ActiveEventLoop) { + fn about_to_wait(&mut self, _event_loop: &dyn winit::event_loop::ActiveEventLoop) { self.context.window.request_redraw(); } @@ -223,22 +224,97 @@ impl Neothesia { } } -// This is so stupid, but winit holds us at gunpoint with create_window deprecation -struct NeothesiaBootstrap(Option, EventLoopProxy); +struct NeothesiaBootstrap { + app: Option, + proxy: EventLoopProxy, + rx: std::sync::mpsc::Receiver, +} -impl ApplicationHandler for NeothesiaBootstrap { - fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { - if self.0.is_some() { +impl ApplicationHandler for NeothesiaBootstrap { + fn proxy_wake_up(&mut self, event_loop: &dyn winit::event_loop::ActiveEventLoop) { + let Some(app) = self.app.as_mut() else { return; + }; + + while let Ok(event) = self.rx.try_recv() { + app.user_event(event_loop, event); } + } + + fn window_event( + &mut self, + event_loop: &dyn winit::event_loop::ActiveEventLoop, + window_id: winit::window::WindowId, + event: WindowEvent, + ) { + let Some(app) = self.app.as_mut() else { + return; + }; + + let mut on_event = |event: WindowEvent| { + app.window_event(event_loop, window_id, &event); + }; - let mut attributes = winit::window::Window::default_attributes() - .with_inner_size(winit::dpi::LogicalSize { + match event { + // Touch event to mouse event translation (temporary until we get touch support) + WindowEvent::PointerButton { + device_id, + state, + position, + primary, + button: ButtonSource::Touch { finger_id, force }, + } => { + let button = ButtonSource::Mouse(MouseButton::Left); + match state { + ElementState::Pressed => { + // Touch might happen anywhere on the screen, so send moved event + on_event(WindowEvent::PointerMoved { + device_id, + position, + primary, + source: PointerSource::Touch { finger_id, force }, + }); + on_event(WindowEvent::PointerButton { + device_id, + state, + position, + primary, + button, + }); + } + ElementState::Released => { + on_event(WindowEvent::PointerButton { + device_id, + state, + position, + primary, + button, + }); + } + } + } + event => on_event(event), + } + } + + fn about_to_wait(&mut self, event_loop: &dyn winit::event_loop::ActiveEventLoop) { + if let Some(app) = self.app.as_mut() { + app.about_to_wait(event_loop) + } + } + + fn can_create_surfaces(&mut self, event_loop: &dyn winit::event_loop::ActiveEventLoop) { + if self.app.is_some() { + return; + } + + let mut attributes = WindowAttributes::default() + .with_surface_size(winit::dpi::LogicalSize { width: 1080.0, height: 720.0, }) .with_title("Neothesia") - .with_min_inner_size(winit::dpi::LogicalSize { + .with_min_surface_size(winit::dpi::LogicalSize { width: 670.0, height: 620.0, }) @@ -247,29 +323,30 @@ impl ApplicationHandler for NeothesiaBootstrap { #[cfg(all(unix, not(target_os = "macos")))] { use winit::platform::{ - startup_notify::{ - self, EventLoopExtStartupNotify, WindowAttributesExtStartupNotify, - }, - wayland::WindowAttributesExtWayland, + startup_notify::{self, EventLoopExtStartupNotify}, + wayland::WindowAttributesWayland, }; + let mut wayland_attrs = WindowAttributesWayland::default() + .with_name("com.github.polymeilex.neothesia", "main"); + if let Some(token) = event_loop.read_token_from_env() { startup_notify::reset_activation_token_env(); - attributes = attributes.with_activation_token(token); + wayland_attrs = WindowAttributesWayland::default().with_activation_token(token); } - attributes = attributes.with_name("com.github.polymeilex.neothesia", "main"); + attributes = attributes.with_platform_attributes(Box::new(wayland_attrs)); }; - let window = event_loop.create_window(attributes).unwrap(); + let window: Arc = Arc::from(event_loop.create_window(attributes).unwrap()); - if let Err(err) = set_window_icon(&window) { + if let Err(err) = set_window_icon(window.as_ref()) { log::error!("Failed to load window icon: {err}"); } - let window_state = WindowState::new(&window); - let size = window.inner_size(); - let window = Arc::new(window); + let window_state = WindowState::new(window.as_ref()); + let size = window.surface_size(); + let (gpu, surface) = pollster::block_on(Gpu::for_window( || window.clone().into(), size.width, @@ -277,76 +354,10 @@ impl ApplicationHandler for NeothesiaBootstrap { )) .unwrap(); - let ctx = Context::new(window, window_state, self.1.clone(), gpu); + let ctx = Context::new(window, window_state, self.proxy.clone(), gpu); let app = Neothesia::new(ctx, surface); - self.0 = Some(app); - } - - fn user_event( - &mut self, - event_loop: &winit::event_loop::ActiveEventLoop, - event: NeothesiaEvent, - ) { - if let Some(app) = self.0.as_mut() { - app.user_event(event_loop, event); - } - } - - fn window_event( - &mut self, - event_loop: &winit::event_loop::ActiveEventLoop, - window_id: winit::window::WindowId, - event: WindowEvent, - ) { - let Some(app) = self.0.as_mut() else { - return; - }; - - let mut on_event = |event: WindowEvent| { - app.window_event(event_loop, window_id, &event); - }; - - // Touch event to mouse event translation (temporary until we get touch support) - if let WindowEvent::Touch(touch) = &event { - // TODO: What to do with touch.id? We somehow want to ignore multitouch - - match touch.phase { - TouchPhase::Started => { - // Touch might happen anywhere on the screen, so send moved event - on_event(WindowEvent::CursorMoved { - device_id: touch.device_id, - position: touch.location, - }); - on_event(WindowEvent::MouseInput { - device_id: touch.device_id, - state: ElementState::Pressed, - button: MouseButton::Left, - }); - } - TouchPhase::Ended | TouchPhase::Cancelled => { - on_event(WindowEvent::MouseInput { - device_id: touch.device_id, - state: ElementState::Released, - button: MouseButton::Left, - }); - } - TouchPhase::Moved => { - on_event(WindowEvent::CursorMoved { - device_id: touch.device_id, - position: touch.location, - }); - } - } - } else { - app.window_event(event_loop, window_id, &event) - } - } - - fn about_to_wait(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { - if let Some(app) = self.0.as_mut() { - app.about_to_wait(event_loop) - } + self.app = Some(app); } } @@ -359,22 +370,28 @@ fn main() { puffin::set_scopes_on(true); // tell puffin to collect data let _server = puffin_http::Server::new("127.0.0.1:8585").ok(); - let event_loop: EventLoop = EventLoop::with_user_event().build().unwrap(); + let event_loop: EventLoop = EventLoop::new().unwrap(); let proxy = event_loop.create_proxy(); + let (proxy, rx) = crate::context::EventLoopProxy::new(proxy); + event_loop - .run_app(&mut NeothesiaBootstrap(None, proxy)) + .run_app(NeothesiaBootstrap { + app: None, + proxy, + rx, + }) .unwrap(); } -fn set_window_icon(window: &winit::window::Window) -> Result<(), Box> { +fn set_window_icon(window: &dyn winit::window::Window) -> Result<(), Box> { use std::io::Cursor; let (icon, w, h) = neothesia_image::load_png(Cursor::new(include_bytes!( "../../flatpak/com.github.polymeilex.neothesia.png" )))?; - window.set_window_icon(Some(winit::window::Icon::from_rgba(icon, w, h)?)); + window.set_window_icon(Some(winit::icon::RgbaIcon::new(icon, w, h)?.into())); Ok(()) } diff --git a/neothesia/src/scene/playing_scene/mod.rs b/neothesia/src/scene/playing_scene/mod.rs index 5aac36f7..17d9add1 100644 --- a/neothesia/src/scene/playing_scene/mod.rs +++ b/neothesia/src/scene/playing_scene/mod.rs @@ -5,7 +5,7 @@ use neothesia_core::render::{ use std::time::Duration; use winit::{ event::WindowEvent, - keyboard::{Key, NamedKey}, + keyboard::{Key, KeyCode, NamedKey}, }; use self::top_bar::TopBar; @@ -281,7 +281,9 @@ impl Scene for PlayingScene { .ok(); } - if event.key_released(Key::Named(NamedKey::Space)) { + if event.key_released_physical_key(KeyCode::Space) + || event.key_released(Key::Character(" ")) + { self.player.pause_resume(); } diff --git a/neothesia/src/scene/playing_scene/rewind_controller.rs b/neothesia/src/scene/playing_scene/rewind_controller.rs index f2255ba6..fea57719 100644 --- a/neothesia/src/scene/playing_scene/rewind_controller.rs +++ b/neothesia/src/scene/playing_scene/rewind_controller.rs @@ -85,7 +85,7 @@ impl RewindController { WindowEvent::KeyboardInput { .. } => { self.handle_keyboard_input(player, event); } - WindowEvent::CursorMoved { position, .. } => { + WindowEvent::PointerMoved { position, .. } => { self.handle_cursor_moved(player, &ctx.window_state, position); } _ => {} diff --git a/neothesia/src/utils/window.rs b/neothesia/src/utils/window.rs index 4cf81a09..51d182ff 100644 --- a/neothesia/src/utils/window.rs +++ b/neothesia/src/utils/window.rs @@ -1,7 +1,7 @@ use winit::{ dpi::{LogicalPosition, PhysicalPosition}, - event::{ElementState, KeyEvent, MouseButton}, - keyboard::{Key, ModifiersState}, + event::{ButtonSource, ElementState, KeyEvent, MouseButton}, + keyboard::{Key, KeyCode, ModifiersState, PhysicalKey}, }; use winit::{ @@ -26,11 +26,11 @@ pub struct WindowState { } impl WindowState { - pub fn new(window: &winit::window::Window) -> Self { + pub fn new(window: &dyn winit::window::Window) -> Self { let scale_factor = window.scale_factor(); let (physical_size, logical_size) = { - let physical_size = window.inner_size(); + let physical_size = window.surface_size(); let logical_size = physical_size.to_logical::(scale_factor); (physical_size, logical_size) }; @@ -58,7 +58,7 @@ impl WindowState { pub fn window_event(&mut self, event: &WindowEvent) { match event { // Windows sets size to 0 on minimise - WindowEvent::Resized(ps) if ps.width > 0 && ps.height > 0 => { + WindowEvent::SurfaceResized(ps) if ps.width > 0 && ps.height > 0 => { self.physical_size.width = ps.width; self.physical_size.height = ps.height; self.logical_size = ps.to_logical(self.scale_factor); @@ -67,7 +67,7 @@ impl WindowState { self.logical_size = self.physical_size.to_logical(self.scale_factor); self.scale_factor = *scale_factor; } - WindowEvent::CursorMoved { position, .. } => { + WindowEvent::PointerMoved { position, .. } => { self.cursor_physical_position = *position; self.cursor_logical_position = position.to_logical(self.scale_factor); } @@ -77,16 +77,16 @@ impl WindowState { WindowEvent::ModifiersChanged(state) => { self.modifiers_state = state.state(); } - WindowEvent::MouseInput { + WindowEvent::PointerButton { state, - button: MouseButton::Left, + button: ButtonSource::Mouse(MouseButton::Left), .. } => { self.left_mouse_btn = *state == ElementState::Pressed; } - WindowEvent::MouseInput { + WindowEvent::PointerButton { state, - button: MouseButton::Right, + button: ButtonSource::Mouse(MouseButton::Right), .. } => { self.right_mouse_btn = *state == ElementState::Pressed; @@ -132,6 +132,7 @@ pub trait WinitEvent { fn key_pressed(&self, key: Key<&str>) -> bool; fn key_released(&self, key: Key<&str>) -> bool; + fn key_released_physical_key(&self, key: KeyCode) -> bool; fn character_released(&self) -> Option<&str>; } @@ -142,11 +143,11 @@ impl WinitEvent for WindowEvent { } fn window_resized(&self) -> bool { - matches!(self, Self::Resized { .. }) + matches!(self, Self::SurfaceResized { .. }) } fn cursor_moved(&self) -> bool { - matches!(self, Self::CursorMoved { .. }) + matches!(self, Self::PointerMoved { .. }) } fn redraw_requested(&self) -> bool { @@ -155,9 +156,9 @@ impl WinitEvent for WindowEvent { fn mouse_pressed(&self, btn: MouseButton) -> bool { match self { - Self::MouseInput { + Self::PointerButton { state: ElementState::Pressed, - button, + button: ButtonSource::Mouse(button), .. } => button == &btn, _ => false, @@ -166,9 +167,9 @@ impl WinitEvent for WindowEvent { fn mouse_released(&self, btn: MouseButton) -> bool { match self { - Self::MouseInput { + Self::PointerButton { state: ElementState::Released, - button, + button: ButtonSource::Mouse(button), .. } => button == &btn, _ => false, @@ -207,6 +208,22 @@ impl WinitEvent for WindowEvent { } } + fn key_released_physical_key(&self, key: KeyCode) -> bool { + match self { + WindowEvent::KeyboardInput { + event: + KeyEvent { + state: ElementState::Released, + physical_key: PhysicalKey::Code(code), + repeat: false, + .. + }, + .. + } => code == &key, + _ => false, + } + } + fn character_released(&self) -> Option<&str> { match self { WindowEvent::KeyboardInput {