diff --git a/Cargo.lock b/Cargo.lock index 4466ae0f344..cfe03a7d210 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,77 +20,94 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8410747ed85a17c4a1e9ed3f5a74d3e7bdcc876cf9a18ff40ae21d645997b2" +checksum = "6cf780eb737f2d4a49ffbd512324d53ad089070f813f7be7f99dbd5123a7f448" dependencies = [ "enumn", "serde", ] +[[package]] +name = "accesskit_atspi_common" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3f1db0583df3e2f52501231d49001d17403bbdae4d14e359776cc87f591b618" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "serde", + "thiserror", + "zvariant", +] + [[package]] name = "accesskit_consumer" -version = "0.16.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" +checksum = "329bc2cce90b24356497badc4824c02986298f7b6c5ea208ceed59532448b6f6" dependencies = [ "accesskit", ] [[package]] name = "accesskit_macos" -version = "0.10.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" +checksum = "5abdf2e75371122f769baeee90ecfd3987b1b00d6ff596fd1eec5d778795e19a" dependencies = [ "accesskit", "accesskit_consumer", - "objc2 0.3.0-beta.3.patch-leaks.3", + "objc2 0.5.1", + "objc2-app-kit", + "objc2-foundation", "once_cell", ] [[package]] name = "accesskit_unix" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8c9b4467d77cacfbc93cee9aa8e7822f6d527c774efdca5f8b3a5280c34847" +checksum = "64bb5d87ed1f38c0e905de65cfe39b8adea00ec00c842308d020ebeb8c5da7ed" dependencies = [ "accesskit", - "accesskit_consumer", - "async-channel", - "async-once-cell", + "accesskit_atspi_common", + "async-channel 2.2.1", + "async-executor", + "async-task", "atspi", "futures-lite", - "once_cell", + "futures-util", "serde", "zbus", ] [[package]] name = "accesskit_windows" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" +checksum = "b2f80369680515d6929059cd19a6d154800506afc36430aed3ddddb9f2ab153a" dependencies = [ "accesskit", "accesskit_consumer", - "once_cell", "paste", "static_assertions", - "windows 0.48.0", + "windows 0.54.0", ] [[package]] name = "accesskit_winit" -version = "0.16.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284218aca17d9e150164428a0ebc7b955f70e3a9a78b4c20894513aabf98a67" +checksum = "585dba99dfbd169ce9ebfa8df51491c8fa283851476a7f96f23c269c730fe8db" dependencies = [ "accesskit", "accesskit_macos", "accesskit_unix", "accesskit_windows", - "winit", + "raw-window-handle 0.6.0", + "winit 0.30.0", ] [[package]] @@ -110,9 +127,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -151,9 +168,30 @@ dependencies = [ "jni-sys", "libc", "log", - "ndk", + "ndk 0.8.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum", + "thiserror", +] + +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.5.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk 0.9.0", + "ndk-context", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror", ] @@ -261,6 +299,19 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +dependencies = [ + "concurrent-queue", + "event-listener 5.3.0", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" version = "1.5.3" @@ -316,12 +367,6 @@ dependencies = [ "event-listener 2.5.3", ] -[[package]] -name = "async-once-cell" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9338790e78aa95a416786ec8389546c4b6a1dfc3dc36071ed9518a9413a542eb" - [[package]] name = "async-process" version = "1.8.0" @@ -533,32 +578,13 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-sys" -version = "0.1.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - [[package]] name = "block-sys" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dd7cf50912cddc06dc5ea7c08c5e81c1b2c842a70d19def1848d54c586fed92" dependencies = [ - "objc-sys 0.3.3", -] - -[[package]] -name = "block2" -version = "0.2.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" -dependencies = [ - "block-sys 0.1.0-beta.1", - "objc2-encode 2.0.0-pre.2", + "objc-sys", ] [[package]] @@ -567,7 +593,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ - "block-sys 0.2.0", + "block-sys", "objc2 0.4.1", ] @@ -586,7 +612,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94c4ef1f913d78636d78d538eec1f18de81e481f44b1be0a81060090530846e1" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-lock", "async-task", "fastrand 2.0.1", @@ -714,6 +740,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" + [[package]] name = "cgl" version = "0.3.2" @@ -869,9 +901,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1164,6 +1196,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" + [[package]] name = "ecolor" version = "0.27.2" @@ -1208,10 +1246,10 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "web-time", + "web-time 0.2.0", "wgpu", "winapi", - "winit", + "winit 0.30.0", ] [[package]] @@ -1243,9 +1281,9 @@ dependencies = [ "puffin", "thiserror", "type-map", - "web-time", + "web-time 0.2.0", "wgpu", - "winit", + "winit 0.30.0", ] [[package]] @@ -1261,9 +1299,9 @@ dependencies = [ "raw-window-handle 0.6.0", "serde", "smithay-clipboard", - "web-time", + "web-time 0.2.0", "webbrowser", - "winit", + "winit 0.30.0", ] [[package]] @@ -1341,7 +1379,7 @@ dependencies = [ "raw-window-handle 0.5.2", "wasm-bindgen", "web-sys", - "winit", + "winit 0.30.0", ] [[package]] @@ -1518,6 +1556,27 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite", +] + [[package]] name = "fancy-regex" version = "0.11.0" @@ -1646,6 +1705,17 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "futures-sink" version = "0.3.28" @@ -1666,6 +1736,7 @@ checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1794,7 +1865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "005459a22af86adc706522d78d360101118e2638ec21df3852fcc626e0dbb212" dependencies = [ "bitflags 2.5.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "cgl", "core-foundation", "dispatch", @@ -1817,10 +1888,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.1.1", "glutin", "raw-window-handle 0.5.2", - "winit", + "winit 0.29.10", ] [[package]] @@ -2039,7 +2110,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -2265,6 +2336,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "line-wrap" version = "0.2.0" @@ -2450,7 +2532,23 @@ dependencies = [ "bitflags 2.5.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.5.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", "num_enum", "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", @@ -2472,6 +2570,15 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + [[package]] name = "nix" version = "0.26.4" @@ -2571,36 +2678,19 @@ dependencies = [ "objc_id", ] -[[package]] -name = "objc-sys" -version = "0.2.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" - [[package]] name = "objc-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" -[[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" -dependencies = [ - "block2 0.2.0-alpha.6", - "objc-sys 0.2.0-beta.2", - "objc2-encode 2.0.0-pre.2", -] - [[package]] name = "objc2" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "objc-sys 0.3.3", + "objc-sys", "objc2-encode 3.0.0", ] @@ -2610,7 +2700,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b25e1034d0e636cd84707ccdaa9f81243d399196b8a773946dcffec0401659" dependencies = [ - "objc-sys 0.3.3", + "objc-sys", "objc2-encode 4.0.1", ] @@ -2637,15 +2727,6 @@ dependencies = [ "objc2-foundation", ] -[[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - [[package]] name = "objc2-encode" version = "3.0.0" @@ -2665,6 +2746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfaefe14254871ea16c7d88968c0ff14ba554712a20d76421eec52f0a7fb8904" dependencies = [ "block2 0.5.0", + "dispatch", "objc2 0.5.1", ] @@ -2700,11 +2782,11 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "orbclient" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8378ac0dfbd4e7895f2d2c1f1345cab3836910baf3a300b000d04250f0c8428f" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "redox_syscall 0.3.5", + "libredox", ] [[package]] @@ -2785,6 +2867,26 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -3082,6 +3184,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[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_users" version = "0.4.3" @@ -3327,9 +3438,9 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +checksum = "7de61fa7334ee8ee1f5c3c58dcc414fb9361e7e8f5bff9d45f4d69eeb89a7169" dependencies = [ "ab_glyph", "log", @@ -3793,11 +3904,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3805,9 +3915,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -3816,9 +3926,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -4223,6 +4333,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webbrowser" version = "1.0.0" @@ -4254,7 +4374,7 @@ checksum = "32ff1bfee408e1028e2e3acbf6d32d98b08a5a059ccbf5f33305534453ba5d3e" dependencies = [ "arrayvec", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "document-features", "js-sys", "log", @@ -4281,7 +4401,7 @@ dependencies = [ "arrayvec", "bit-vec", "bitflags 2.5.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "codespan-reporting", "document-features", "indexmap", @@ -4310,7 +4430,7 @@ dependencies = [ "ash", "bitflags 2.5.0", "block", - "cfg_aliases", + "cfg_aliases 0.1.1", "core-graphics-types", "glow", "glutin_wgl_sys", @@ -4325,7 +4445,7 @@ dependencies = [ "log", "metal", "naga", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", "parking_lot", @@ -4391,23 +4511,24 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.48.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-implement", - "windows-interface", + "windows-core 0.51.1", "windows-targets 0.48.5", ] [[package]] name = "windows" -version = "0.51.1" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.48.5", + "windows-core 0.54.0", + "windows-implement", + "windows-interface", + "windows-targets 0.52.5", ] [[package]] @@ -4419,26 +4540,45 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.5", +] + [[package]] name = "windows-implement" -version = "0.48.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" +checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "windows-interface" -version = "0.48.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" +checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", +] + +[[package]] +name = "windows-result" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] @@ -4653,12 +4793,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" dependencies = [ "ahash", - "android-activity", + "android-activity 0.5.0", "atomic-waker", "bitflags 2.5.0", "bytemuck", "calloop", - "cfg_aliases", + "cfg_aliases 0.1.1", "core-foundation", "core-graphics", "cursor-icon", @@ -4667,17 +4807,15 @@ dependencies = [ "libc", "log", "memmap2", - "ndk", - "ndk-sys", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", "objc2 0.4.1", "once_cell", "orbclient", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.0", "redox_syscall 0.3.5", "rustix 0.38.21", - "sctk-adwaita", "smithay-client-toolkit", "smol_str", "unicode-segmentation", @@ -4688,13 +4826,64 @@ dependencies = [ "wayland-protocols", "wayland-protocols-plasma", "web-sys", - "web-time", + "web-time 0.2.0", "windows-sys 0.48.0", "x11-dl", "x11rb", "xkbcommon-dl", ] +[[package]] +name = "winit" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9e6d5d66cbf702e0dd820302144f51b69a95acdc495dd98ca280ff206562b1" +dependencies = [ + "ahash", + "android-activity 0.6.0", + "atomic-waker", + "bitflags 2.5.0", + "bytemuck", + "calloop", + "cfg_aliases 0.2.0", + "concurrent-queue", + "core-foundation", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk 0.9.0", + "objc2 0.5.1", + "objc2-app-kit", + "objc2-foundation", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", + "redox_syscall 0.4.1", + "rustix 0.38.21", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time 1.1.0", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + [[package]] name = "winnow" version = "0.5.15" @@ -4757,9 +4946,9 @@ dependencies = [ [[package]] name = "xkbcommon-dl" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ "bitflags 2.5.0", "dlib", diff --git a/Cargo.toml b/Cargo.toml index 0853df671d6..ebf5ff3a226 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,7 @@ wgpu = { version = "0.20.0", default-features = false, features = [ # Make the renderer `Sync` even on wasm32, because it makes the code simpler: "fragile-send-sync-non-atomic-wasm", ] } -winit = { version = "0.29.4", default-features = false } +winit = { version = "0.30.0", default-features = false } [workspace.lints.rust] diff --git a/crates/eframe/src/epi.rs b/crates/eframe/src/epi.rs index db39a08b15b..c3785bce6fb 100644 --- a/crates/eframe/src/epi.rs +++ b/crates/eframe/src/epi.rs @@ -23,7 +23,7 @@ use static_assertions::assert_not_impl_any; #[cfg(not(target_arch = "wasm32"))] #[cfg(any(feature = "glow", feature = "wgpu"))] -pub use winit::{event_loop::EventLoopBuilder, window::WindowBuilder}; +pub use winit::{event_loop::EventLoopBuilder, window::WindowAttributes}; /// Hook into the building of an event loop before it is run /// diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index b09f0f0e0c7..95d124d1a2f 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -1,7 +1,7 @@ //! Common tools used by [`super::glow_integration`] and [`super::wgpu_integration`]. use web_time::Instant; -use winit::event_loop::EventLoopWindowTarget; +use winit::event_loop::ActiveEventLoop; use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _}; @@ -10,9 +10,9 @@ use egui_winit::{EventResponse, WindowSettings}; use crate::{epi, Theme}; -pub fn viewport_builder( +pub fn viewport_builder( egui_zoom_factor: f32, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, native_options: &mut epi::NativeOptions, window_settings: Option, ) -> ViewportBuilder { @@ -90,10 +90,7 @@ pub fn apply_window_settings( } } -fn largest_monitor_point_size( - egui_zoom_factor: f32, - event_loop: &EventLoopWindowTarget, -) -> egui::Vec2 { +fn largest_monitor_point_size(egui_zoom_factor: f32, event_loop: &ActiveEventLoop) -> egui::Vec2 { crate::profile_function!(); let mut max_size = egui::Vec2::ZERO; @@ -217,7 +214,7 @@ impl EpiIntegration { } #[cfg(feature = "accesskit")] - pub fn init_accesskit + Send>( + pub fn init_accesskit + Send>( &self, egui_winit: &mut egui_winit::State, window: &winit::window::Window, @@ -226,15 +223,7 @@ impl EpiIntegration { crate::profile_function!(); let egui_ctx = self.egui_ctx.clone(); - egui_winit.init_accesskit(window, event_loop_proxy, move || { - // This function is called when an accessibility client - // (e.g. screen reader) makes its first request. If we got here, - // we know that an accessibility tree is actually wanted. - egui_ctx.enable_accesskit(); - // Enqueue a repaint so we'll receive a full tree update soon. - egui_ctx.request_repaint(); - egui_ctx.accesskit_placeholder_tree_update() - }); + egui_winit.init_accesskit(window, event_loop_proxy, egui_ctx); } /// If `true`, it is time to close the native window. diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index 0fbb48a09c7..d53ddf3403b 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -22,7 +22,7 @@ use glutin::{ surface::GlSurface, }; use winit::{ - event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget}, + event_loop::{ActiveEventLoop, EventLoop, EventLoopProxy}, window::{Window, WindowId}, }; @@ -31,8 +31,6 @@ use egui::{ ViewportBuilder, ViewportClass, ViewportId, ViewportIdMap, ViewportIdPair, ViewportInfo, ViewportOutput, }; -#[cfg(feature = "accesskit")] -use egui_winit::accesskit_winit; use crate::{ native::{epi_integration::EpiIntegration, winit_integration::create_egui_context}, @@ -145,7 +143,7 @@ impl GlowWinitApp { #[allow(unsafe_code)] fn create_glutin_windowed_context( egui_ctx: &egui::Context, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, storage: Option<&dyn Storage>, native_options: &mut NativeOptions, ) -> Result<(GlutinWindowContext, egui_glow::Painter)> { @@ -189,10 +187,7 @@ impl GlowWinitApp { Ok((glutin_window_context, painter)) } - fn init_run_state( - &mut self, - event_loop: &EventLoopWindowTarget, - ) -> Result<&mut GlowWinitRunning> { + fn init_run_state(&mut self, event_loop: &ActiveEventLoop) -> Result<&mut GlowWinitRunning> { crate::profile_function!(); let storage = epi_integration::create_storage( @@ -321,7 +316,7 @@ impl GlowWinitApp { let painter = Rc::downgrade(&painter); let beginning = integration.beginning; - let event_loop: *const EventLoopWindowTarget = event_loop; + let event_loop: *const ActiveEventLoop = event_loop; egui::Context::set_immediate_viewport_renderer(move |egui_ctx, immediate_viewport| { if let (Some(glutin), Some(painter)) = (glutin.upgrade(), painter.upgrade()) { @@ -392,7 +387,7 @@ impl WinitApp for GlowWinitApp { fn run_ui_and_paint( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, window_id: WindowId, ) -> EventResult { if let Some(running) = &mut self.running { @@ -404,7 +399,7 @@ impl WinitApp for GlowWinitApp { fn on_event( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, event: &winit::event::Event, ) -> Result { crate::profile_function!(winit_integration::short_event_description(event)); @@ -471,9 +466,10 @@ impl WinitApp for GlowWinitApp { } #[cfg(feature = "accesskit")] - winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest( - accesskit_winit::ActionRequestEvent { request, window_id }, - )) => { + winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest { + request, + window_id, + }) => { if let Some(running) = &self.running { let mut glutin = running.glutin.borrow_mut(); if let Some(viewport_id) = glutin.viewport_from_window.get(window_id).copied() { @@ -499,7 +495,7 @@ impl WinitApp for GlowWinitApp { impl GlowWinitRunning { fn run_ui_and_paint( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, window_id: WindowId, ) -> EventResult { crate::profile_function!(); @@ -894,7 +890,7 @@ impl GlutinWindowContext { egui_ctx: &egui::Context, viewport_builder: ViewportBuilder, native_options: &NativeOptions, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, ) -> Result { crate::profile_function!(); @@ -943,7 +939,7 @@ impl GlutinWindowContext { let display_builder = glutin_winit::DisplayBuilder::new() // we might want to expose this option to users in the future. maybe using an env var or using native_options. .with_preference(glutin_winit::ApiPreference::FallbackEgl) // https://github.com/emilk/egui/issues/2520#issuecomment-1367841150 - .with_window_builder(Some(egui_winit::create_winit_window_builder( + .with_window_builder(Some(egui_winit::create_winit_window_attributes( egui_ctx, event_loop, viewport_builder.clone(), @@ -1066,7 +1062,7 @@ impl GlutinWindowContext { /// Create a surface, window, and winit integration for all viewports lacking any of that. /// /// Errors will be logged. - fn initialize_all_windows(&mut self, event_loop: &EventLoopWindowTarget) { + fn initialize_all_windows(&mut self, event_loop: &ActiveEventLoop) { crate::profile_function!(); let viewports: Vec = self.viewports.keys().copied().collect(); @@ -1083,7 +1079,7 @@ impl GlutinWindowContext { pub(crate) fn initialize_window( &mut self, viewport_id: ViewportId, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, ) -> Result<()> { crate::profile_function!(); @@ -1249,7 +1245,7 @@ impl GlutinWindowContext { fn handle_viewport_output( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, egui_ctx: &egui::Context, viewport_output: &ViewportIdMap, ) { @@ -1373,7 +1369,7 @@ fn initialize_or_update_viewport( /// This is called (via a callback) by user code to render immediate viewports, /// i.e. viewport that are directly nested inside a parent viewport. fn render_immediate_viewport( - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, egui_ctx: &egui::Context, glutin: &RefCell, painter: &RefCell, diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 3ee249edf76..6d5f9b3797b 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -18,7 +18,7 @@ fn create_event_loop_builder( native_options: &mut epi::NativeOptions, ) -> EventLoopBuilder { crate::profile_function!(); - let mut event_loop_builder = winit::event_loop::EventLoopBuilder::with_user_event(); + let mut event_loop_builder = winit::event_loop::EventLoop::with_user_event(); if let Some(hook) = std::mem::take(&mut native_options.event_loop_builder) { hook(&mut event_loop_builder); diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index f365d74ad93..8abf4f7cd14 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -11,7 +11,7 @@ use egui_winit::ActionRequested; use parking_lot::Mutex; use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _}; use winit::{ - event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget}, + event_loop::{ActiveEventLoop, EventLoop, EventLoopProxy}, window::{Window, WindowId}, }; @@ -20,8 +20,6 @@ use egui::{ DeferredViewportUiCallback, FullOutput, ImmediateViewport, ViewportBuilder, ViewportClass, ViewportId, ViewportIdMap, ViewportIdPair, ViewportIdSet, ViewportInfo, ViewportOutput, }; -#[cfg(feature = "accesskit")] -use egui_winit::accesskit_winit; use crate::{ native::{epi_integration::EpiIntegration, winit_integration::EventResult}, @@ -119,7 +117,7 @@ impl WgpuWinitApp { } /// Create a window for all viewports lacking one. - fn initialized_all_windows(&mut self, event_loop: &EventLoopWindowTarget) { + fn initialized_all_windows(&mut self, event_loop: &ActiveEventLoop) { let Some(running) = &mut self.running else { return; }; @@ -142,11 +140,7 @@ impl WgpuWinitApp { } #[cfg(target_os = "android")] - fn recreate_window( - &self, - event_loop: &EventLoopWindowTarget, - running: &WgpuWinitRunning, - ) { + fn recreate_window(&self, event_loop: &ActiveEventLoop, running: &WgpuWinitRunning) { let SharedState { egui_ctx, viewports, @@ -178,7 +172,7 @@ impl WgpuWinitApp { fn init_run_state( &mut self, egui_ctx: egui::Context, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, storage: Option>, window: Window, builder: ViewportBuilder, @@ -310,7 +304,7 @@ impl WgpuWinitApp { let shared = Rc::downgrade(&shared); let beginning = integration.beginning; - let event_loop: *const EventLoopWindowTarget = event_loop; + let event_loop: *const ActiveEventLoop = event_loop; egui::Context::set_immediate_viewport_renderer(move |_egui_ctx, immediate_viewport| { if let Some(shared) = shared.upgrade() { @@ -376,7 +370,7 @@ impl WinitApp for WgpuWinitApp { fn run_ui_and_paint( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, window_id: WindowId, ) -> EventResult { self.initialized_all_windows(event_loop); @@ -390,7 +384,7 @@ impl WinitApp for WgpuWinitApp { fn on_event( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, event: &winit::event::Event, ) -> Result { crate::profile_function!(winit_integration::short_event_description(event)); @@ -473,9 +467,10 @@ impl WinitApp for WgpuWinitApp { } #[cfg(feature = "accesskit")] - winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest( - accesskit_winit::ActionRequestEvent { request, window_id }, - )) => { + winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest { + request, + window_id, + }) => { if let Some(running) = &mut self.running { let mut shared_lock = running.shared.borrow_mut(); let SharedState { @@ -861,7 +856,7 @@ impl Viewport { /// Create winit window, if needed. fn initialize_window( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, egui_ctx: &egui::Context, windows_id: &mut HashMap, painter: &mut egui_wgpu::winit::Painter, @@ -906,7 +901,7 @@ impl Viewport { fn create_window( egui_ctx: &egui::Context, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, storage: Option<&dyn Storage>, native_options: &mut NativeOptions, ) -> Result<(Window, ViewportBuilder), winit::error::OsError> { @@ -927,7 +922,7 @@ fn create_window( } fn render_immediate_viewport( - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, beginning: Instant, shared: &RefCell, immediate_viewport: ImmediateViewport<'_>, diff --git a/crates/eframe/src/native/winit_integration.rs b/crates/eframe/src/native/winit_integration.rs index fbbd7910732..8c2722a9eb7 100644 --- a/crates/eframe/src/native/winit_integration.rs +++ b/crates/eframe/src/native/winit_integration.rs @@ -1,10 +1,12 @@ use std::{sync::Arc, time::Instant}; use winit::{ - event_loop::EventLoopWindowTarget, + event_loop::ActiveEventLoop, window::{Window, WindowId}, }; +#[cfg(feature = "accesskit")] +use egui::accesskit; use egui::ViewportId; #[cfg(feature = "accesskit")] use egui_winit::accesskit_winit; @@ -48,13 +50,25 @@ pub enum UserEvent { /// A request related to [`accesskit`](https://accesskit.dev/). #[cfg(feature = "accesskit")] - AccessKitActionRequest(accesskit_winit::ActionRequestEvent), + AccessKitActionRequest { + request: accesskit::ActionRequest, + window_id: WindowId, + }, } #[cfg(feature = "accesskit")] -impl From for UserEvent { - fn from(inner: accesskit_winit::ActionRequestEvent) -> Self { - Self::AccessKitActionRequest(inner) +impl From for UserEvent { + fn from(event: accesskit_winit::Event) -> Self { + match event.window_event { + accesskit_winit::WindowEvent::InitialTreeRequested => todo!(), + accesskit_winit::WindowEvent::AccessibilityDeactivated => todo!(), + accesskit_winit::WindowEvent::ActionRequested(request) => { + Self::AccessKitActionRequest { + request, + window_id: event.window_id, + } + } + } } } @@ -70,13 +84,13 @@ pub trait WinitApp { fn run_ui_and_paint( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, window_id: WindowId, ) -> EventResult; fn on_event( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, event: &winit::event::Event, ) -> crate::Result; } @@ -120,7 +134,7 @@ pub fn short_event_description(event: &winit::event::Event) -> &'stat winit::event::Event::UserEvent(user_event) => match user_event { UserEvent::RequestRepaint { .. } => "UserEvent::RequestRepaint", #[cfg(feature = "accesskit")] - UserEvent::AccessKitActionRequest(_) => "UserEvent::AccessKitActionRequest", + UserEvent::AccessKitActionRequest { .. } => "UserEvent::AccessKitActionRequest", }, _ => egui_winit::short_generic_event_description(event), } diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index fc2b8a53620..e688becf0dd 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -67,7 +67,7 @@ winit = { workspace = true, default-features = false, features = ["rwh_06"] } #! ### Optional dependencies # feature accesskit -accesskit_winit = { version = "0.16.0", optional = true } +accesskit_winit = { version = "0.20.0", optional = true } ## Enable this when generating docs. document-features = { workspace = true, optional = true } diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index abadd9ee5c2..d9d0fdd0511 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -31,7 +31,7 @@ pub(crate) use profiling_scopes::*; use winit::{ dpi::{PhysicalPosition, PhysicalSize}, - event_loop::EventLoopWindowTarget, + event_loop::ActiveEventLoop, window::{CursorGrabMode, Window, WindowButtons, WindowLevel}, }; @@ -158,14 +158,14 @@ impl State { } #[cfg(feature = "accesskit")] - pub fn init_accesskit + Send>( + pub fn init_accesskit + Send + 'static>( &mut self, window: &Window, event_loop_proxy: winit::event_loop::EventLoopProxy, - initial_tree_update_factory: impl 'static + FnOnce() -> accesskit::TreeUpdate + Send, + initial_tree_update_factory: impl 'static + accesskit::ActivationHandler + Send, ) { crate::profile_function!(); - self.accesskit = Some(accesskit_winit::Adapter::new( + self.accesskit = Some(accesskit_winit::Adapter::with_mixed_handlers( window, initial_tree_update_factory, event_loop_proxy, @@ -263,7 +263,7 @@ impl State { crate::profile_function!(short_window_event_description(event)); #[cfg(feature = "accesskit")] - if let Some(accesskit) = &self.accesskit { + if let Some(accesskit) = &mut self.accesskit { accesskit.process_event(window, event); } @@ -458,6 +458,7 @@ impl State { // Things that may require repaint: WindowEvent::RedrawRequested + | WindowEvent::PanGesture { .. } | WindowEvent::CursorEntered { .. } | WindowEvent::Destroyed | WindowEvent::Occluded(_) @@ -473,13 +474,13 @@ impl State { // Things we completely ignore: WindowEvent::ActivationTokenDone { .. } | WindowEvent::AxisMotion { .. } - | WindowEvent::SmartMagnify { .. } - | WindowEvent::TouchpadRotate { .. } => EventResponse { + | WindowEvent::DoubleTapGesture { .. } + | WindowEvent::RotationGesture { .. } => EventResponse { repaint: false, consumed: false, }, - WindowEvent::TouchpadMagnify { delta, .. } => { + WindowEvent::PinchGesture { delta, .. } => { // Positive delta values indicate magnification (zooming in). // Negative delta values indicate shrinking (zooming out). let zoom_factor = (*delta as f32).exp(); @@ -861,7 +862,7 @@ impl State { } #[cfg(feature = "accesskit")] - if let Some(accesskit) = self.accesskit.as_ref() { + if let Some(accesskit) = self.accesskit.as_mut() { if let Some(update) = accesskit_update { crate::profile_scope!("accesskit"); accesskit.update_if_active(|| update); @@ -882,7 +883,7 @@ impl State { if let Some(winit_cursor_icon) = translate_cursor(cursor_icon) { window.set_cursor_visible(true); - window.set_cursor_icon(winit_cursor_icon); + window.set_cursor(winit_cursor_icon); } else { window.set_cursor_visible(false); } @@ -1520,32 +1521,32 @@ fn process_viewport_command( /// Build and intitlaize a window. /// -/// Wrapper around `create_winit_window_builder` and `apply_viewport_builder_to_window`. +/// Wrapper around `create_winit_window_attributes` and `apply_viewport_builder_to_window`. /// /// # Errors /// Possible causes of error include denied permission, incompatible system, and lack of memory. -pub fn create_window( +pub fn create_window( egui_ctx: &egui::Context, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, viewport_builder: &ViewportBuilder, ) -> Result { crate::profile_function!(); - let window_builder = - create_winit_window_builder(egui_ctx, event_loop, viewport_builder.clone()); + let window_attributes = + create_winit_window_attributes(egui_ctx, event_loop, viewport_builder.clone()); let window = { crate::profile_scope!("WindowBuilder::build"); - window_builder.build(event_loop)? + event_loop.create_window(window_attributes)? }; apply_viewport_builder_to_window(egui_ctx, &window, viewport_builder); Ok(window) } -pub fn create_winit_window_builder( +pub fn create_winit_window_attributes( egui_ctx: &egui::Context, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, viewport_builder: ViewportBuilder, -) -> winit::window::WindowBuilder { +) -> winit::window::WindowAttributes { crate::profile_function!(); // We set sizes and positions in egui:s own ui points, which depends on the egui @@ -1604,7 +1605,7 @@ pub fn create_winit_window_builder( clamp_size_to_monitor_size: _, // Handled in `viewport_builder` in `epi_integration.rs` } = viewport_builder; - let mut window_builder = winit::window::WindowBuilder::new() + let mut window_attributes = winit::window::WindowAttributes::default() .with_title(title.unwrap_or_else(|| "egui window".to_owned())) .with_transparent(transparent.unwrap_or(false)) .with_decorations(decorations.unwrap_or(true)) @@ -1635,28 +1636,28 @@ pub fn create_winit_window_builder( .with_active(active.unwrap_or(true)); if let Some(size) = inner_size { - window_builder = window_builder.with_inner_size(PhysicalSize::new( + window_attributes = window_attributes.with_inner_size(PhysicalSize::new( pixels_per_point * size.x, pixels_per_point * size.y, )); } if let Some(size) = min_inner_size { - window_builder = window_builder.with_min_inner_size(PhysicalSize::new( + window_attributes = window_attributes.with_min_inner_size(PhysicalSize::new( pixels_per_point * size.x, pixels_per_point * size.y, )); } if let Some(size) = max_inner_size { - window_builder = window_builder.with_max_inner_size(PhysicalSize::new( + window_attributes = window_attributes.with_max_inner_size(PhysicalSize::new( pixels_per_point * size.x, pixels_per_point * size.y, )); } if let Some(pos) = position { - window_builder = window_builder.with_position(PhysicalPosition::new( + window_attributes = window_attributes.with_position(PhysicalPosition::new( pixels_per_point * pos.x, pixels_per_point * pos.y, )); @@ -1664,13 +1665,13 @@ pub fn create_winit_window_builder( if let Some(icon) = icon { let winit_icon = to_winit_icon(&icon); - window_builder = window_builder.with_window_icon(winit_icon); + window_attributes = window_attributes.with_window_icon(winit_icon); } #[cfg(all(feature = "wayland", target_os = "linux"))] if let Some(app_id) = _app_id { use winit::platform::wayland::WindowBuilderExtWayland as _; - window_builder = window_builder.with_name(app_id, ""); + window_attributes = window_attributes.with_name(app_id, ""); } #[cfg(all(feature = "x11", target_os = "linux"))] @@ -1678,7 +1679,7 @@ pub fn create_winit_window_builder( if let Some(window_type) = _window_type { use winit::platform::x11::WindowBuilderExtX11 as _; use winit::platform::x11::XWindowType; - window_builder = window_builder.with_x11_window_type(vec![match window_type { + window_attributes = window_attributes.with_x11_window_type(vec![match window_type { egui::X11WindowType::Normal => XWindowType::Normal, egui::X11WindowType::Utility => XWindowType::Utility, egui::X11WindowType::Dock => XWindowType::Dock, @@ -1699,26 +1700,26 @@ pub fn create_winit_window_builder( #[cfg(target_os = "windows")] { - use winit::platform::windows::WindowBuilderExtWindows as _; + use winit::platform::windows::WindowAttributesExtWindows as _; if let Some(enable) = _drag_and_drop { - window_builder = window_builder.with_drag_and_drop(enable); + window_attributes = window_attributes.with_drag_and_drop(enable); } if let Some(show) = _taskbar { - window_builder = window_builder.with_skip_taskbar(!show); + window_attributes = window_attributes.with_skip_taskbar(!show); } } #[cfg(target_os = "macos")] { use winit::platform::macos::WindowBuilderExtMacOS as _; - window_builder = window_builder + window_attributes = window_attributes .with_title_hidden(!_title_shown.unwrap_or(true)) .with_titlebar_buttons_hidden(!_titlebar_buttons_shown.unwrap_or(true)) .with_titlebar_transparent(!_titlebar_shown.unwrap_or(true)) .with_fullsize_content_view(_fullsize_content_view.unwrap_or(false)); } - window_builder + window_attributes } fn to_winit_icon(icon: &egui::IconData) -> Option { @@ -1736,7 +1737,7 @@ fn to_winit_icon(icon: &egui::IconData) -> Option { } } -/// Applies what `create_winit_window_builder` couldn't +/// Applies what `create_winit_window_attributes` couldn't pub fn apply_viewport_builder_to_window( egui_ctx: &egui::Context, window: &Window, @@ -1749,7 +1750,7 @@ pub fn apply_viewport_builder_to_window( } { - // In `create_winit_window_builder` we didn't know + // In `create_winit_window_attributes` we didn't know // on what monitor the window would appear, so we didn't know // how to translate egui ui point to native physical pixels. // Now we do know: @@ -1842,16 +1843,17 @@ pub fn short_window_event_description(event: &winit::event::WindowEvent) -> &'st WindowEvent::CursorLeft { .. } => "WindowEvent::CursorLeft", WindowEvent::MouseWheel { .. } => "WindowEvent::MouseWheel", WindowEvent::MouseInput { .. } => "WindowEvent::MouseInput", - WindowEvent::TouchpadMagnify { .. } => "WindowEvent::TouchpadMagnify", + WindowEvent::PinchGesture { .. } => "WindowEvent::PinchGesture", WindowEvent::RedrawRequested { .. } => "WindowEvent::RedrawRequested", - WindowEvent::SmartMagnify { .. } => "WindowEvent::SmartMagnify", - WindowEvent::TouchpadRotate { .. } => "WindowEvent::TouchpadRotate", + WindowEvent::DoubleTapGesture { .. } => "WindowEvent::DoubleTapGesture", + WindowEvent::RotationGesture { .. } => "WindowEvent::RotationGesture", WindowEvent::TouchpadPressure { .. } => "WindowEvent::TouchpadPressure", WindowEvent::AxisMotion { .. } => "WindowEvent::AxisMotion", WindowEvent::Touch { .. } => "WindowEvent::Touch", WindowEvent::ScaleFactorChanged { .. } => "WindowEvent::ScaleFactorChanged", WindowEvent::ThemeChanged { .. } => "WindowEvent::ThemeChanged", WindowEvent::Occluded { .. } => "WindowEvent::Occluded", + WindowEvent::PanGesture { .. } => "WindowEvent::PanGesture", } } diff --git a/crates/egui-winit/src/window_settings.rs b/crates/egui-winit/src/window_settings.rs index c59a0f451ce..9ac9de5bf61 100644 --- a/crates/egui-winit/src/window_settings.rs +++ b/crates/egui-winit/src/window_settings.rs @@ -100,10 +100,10 @@ impl WindowSettings { } } - pub fn clamp_position_to_monitors( + pub fn clamp_position_to_monitors( &mut self, egui_zoom_factor: f32, - event_loop: &winit::event_loop::EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, ) { // If the app last ran on two monitors and only one is now connected, then // the given position is invalid. @@ -127,9 +127,9 @@ impl WindowSettings { } } -fn clamp_pos_to_monitors( +fn clamp_pos_to_monitors( egui_zoom_factor: f32, - event_loop: &winit::event_loop::EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, window_size_pts: egui::Vec2, position_px: &mut egui::Pos2, ) { diff --git a/crates/egui/Cargo.toml b/crates/egui/Cargo.toml index a1929f060ad..a0023423aab 100644 --- a/crates/egui/Cargo.toml +++ b/crates/egui/Cargo.toml @@ -91,7 +91,7 @@ ahash.workspace = true nohash-hasher.workspace = true #! ### Optional dependencies -accesskit = { version = "0.12", optional = true } +accesskit = { version = "0.14", optional = true } backtrace = { workspace = true, optional = true } diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index f697fb4b8e5..d190c1c19e6 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -388,8 +388,6 @@ struct ContextImpl { #[cfg(feature = "accesskit")] is_accesskit_enabled: bool, - #[cfg(feature = "accesskit")] - accesskit_node_classes: accesskit::NodeClassSet, loaders: Arc, } @@ -678,6 +676,19 @@ impl ContextImpl { #[derive(Clone)] pub struct Context(Arc>); +#[cfg(feature = "accesskit")] +impl accesskit::ActivationHandler for Context { + fn request_initial_tree(&mut self) -> Option { + // This function is called when an accessibility client + // (e.g. screen reader) makes its first request. If we got here, + // we know that an accessibility tree is actually wanted. + self.enable_accesskit(); + // Enqueue a repaint so we'll receive a full tree update soon. + self.request_repaint(); + Some(self.accesskit_placeholder_tree_update()) + } +} + impl std::fmt::Debug for Context { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Context").finish_non_exhaustive() @@ -1995,12 +2006,7 @@ impl ContextImpl { state .node_builders .into_iter() - .map(|(id, builder)| { - ( - id.accesskit_id(), - builder.build(&mut self.accesskit_node_classes), - ) - }) + .map(|(id, builder)| (id.accesskit_id(), builder.build())) .collect() }; let focus_id = self @@ -2859,11 +2865,8 @@ impl Context { use accesskit::{NodeBuilder, Role, Tree, TreeUpdate}; let root_id = crate::accesskit_root_id().accesskit_id(); - self.write(|ctx| TreeUpdate { - nodes: vec![( - root_id, - NodeBuilder::new(Role::Window).build(&mut ctx.accesskit_node_classes), - )], + self.write(|_ctx| TreeUpdate { + nodes: vec![(root_id, NodeBuilder::new(Role::Window).build())], tree: Some(Tree::new(root_id)), focus: root_id, }) diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 44eb4f74bd6..accdf4d5dbe 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -807,7 +807,7 @@ impl Response { info: crate::WidgetInfo, ) { use crate::WidgetType; - use accesskit::{Checked, Role}; + use accesskit::{Role, Toggled}; self.fill_accesskit_node_common(builder); builder.set_role(match info.typ { @@ -819,7 +819,7 @@ impl Response { } WidgetType::Checkbox => Role::CheckBox, WidgetType::RadioButton => Role::RadioButton, - WidgetType::SelectableLabel => Role::ToggleButton, + WidgetType::SelectableLabel => Role::Button, WidgetType::ComboBox => Role::ComboBox, WidgetType::Slider => Role::Slider, WidgetType::DragValue => Role::SpinButton, @@ -837,14 +837,14 @@ impl Response { builder.set_numeric_value(value); } if let Some(selected) = info.selected { - builder.set_checked(if selected { - Checked::True + builder.set_toggled(if selected { + Toggled::True } else { - Checked::False + Toggled::False }); } else if matches!(info.typ, WidgetType::Checkbox) { // Indeterminate state - builder.set_checked(Checked::Mixed); + builder.set_toggled(Toggled::Mixed); } } diff --git a/crates/egui_glow/examples/pure_glow.rs b/crates/egui_glow/examples/pure_glow.rs index 70f07421475..b23e096bef1 100644 --- a/crates/egui_glow/examples/pure_glow.rs +++ b/crates/egui_glow/examples/pure_glow.rs @@ -23,13 +23,13 @@ impl GlutinWindowContext { // refactor this function to use `glutin-winit` crate eventually. // preferably add android support at the same time. #[allow(unsafe_code)] - unsafe fn new(event_loop: &winit::event_loop::EventLoopWindowTarget) -> Self { + unsafe fn new(event_loop: &winit::event_loop::ActiveEventLoop) -> Self { use glutin::context::NotCurrentGlContext; use glutin::display::GetGlDisplay; use glutin::display::GlDisplay; use glutin::prelude::GlSurface; use rwh_05::HasRawWindowHandle; - let winit_window_builder = winit::window::WindowBuilder::new() + let winit_window_attributes = winit::window::WindowAttributes::default() .with_resizable(true) .with_inner_size(winit::dpi::LogicalSize { width: 800.0, @@ -48,7 +48,7 @@ impl GlutinWindowContext { let (mut window, gl_config) = glutin_winit::DisplayBuilder::new() // let glutin-winit helper crate handle the complex parts of opengl context creation .with_preference(glutin_winit::ApiPreference::FallbackEgl) // https://github.com/emilk/egui/issues/2520#issuecomment-1367841150 - .with_window_builder(Some(winit_window_builder.clone())) + .with_window_attributes(Some(winit_window_attributes.clone())) .build( event_loop, config_template_builder, @@ -87,7 +87,7 @@ impl GlutinWindowContext { // this is where the window is created, if it has not been created while searching for suitable gl_config let window = window.take().unwrap_or_else(|| { log::debug!("window doesn't exist yet. creating one now with finalize_window"); - glutin_winit::finalize_window(event_loop, winit_window_builder.clone(), &gl_config) + glutin_winit::finalize_window(event_loop, winit_window_attributes.clone(), &gl_config) .expect("failed to finalize glutin window") }); let (width, height): (u32, u32) = window.inner_size().into(); diff --git a/crates/egui_glow/src/winit.rs b/crates/egui_glow/src/winit.rs index 0c407ccb75d..41b0b29f17b 100644 --- a/crates/egui_glow/src/winit.rs +++ b/crates/egui_glow/src/winit.rs @@ -22,8 +22,8 @@ pub struct EguiGlow { impl EguiGlow { /// For automatic shader version detection set `shader_version` to `None`. - pub fn new( - event_loop: &winit::event_loop::EventLoopWindowTarget, + pub fn new( + event_loop: &winit::event_loop::ActiveEventLoop, gl: std::sync::Arc, shader_version: Option, native_pixels_per_point: Option,