From 2bf1f02ea0028f48e4077960b382da75807739b8 Mon Sep 17 00:00:00 2001 From: josef Date: Tue, 25 Jun 2024 00:21:17 +0200 Subject: [PATCH 1/6] update winit to 0.30.3 --- Cargo.lock | 648 ++++++++++++------ Cargo.toml | 10 +- crates/eframe/Cargo.toml | 11 +- crates/eframe/src/epi.rs | 2 +- crates/eframe/src/native/epi_integration.rs | 13 +- crates/eframe/src/native/glow_integration.rs | 54 +- crates/eframe/src/native/run.rs | 2 +- crates/eframe/src/native/wgpu_integration.rs | 23 +- crates/eframe/src/native/winit_integration.rs | 22 +- crates/egui-winit/Cargo.toml | 2 +- crates/egui-winit/src/lib.rs | 60 +- crates/egui-winit/src/window_settings.rs | 16 +- crates/egui/Cargo.toml | 2 +- crates/egui/src/context.rs | 17 +- crates/egui/src/response.rs | 12 +- crates/egui_glow/Cargo.toml | 2 +- crates/egui_glow/examples/pure_glow.rs | 6 +- crates/egui_glow/src/winit.rs | 4 +- 18 files changed, 575 insertions(+), 331 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 125af9adedf..42a5de6b158 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,76 +20,94 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.12.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8410747ed85a17c4a1e9ed3f5a74d3e7bdcc876cf9a18ff40ae21d645997b2" +checksum = "0ac5b518d65f20dc920b3a7bb92bb2b90cdb301416f27c2a55a128cd99f75c0c" dependencies = [ "enumn", "serde", ] +[[package]] +name = "accesskit_atspi_common" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d50c9c8c4e3ad243b8a567ddf3595c6eb064304b76baf246bb069700e03a2e" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "serde", + "thiserror", + "zvariant", +] + [[package]] name = "accesskit_consumer" -version = "0.16.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" +checksum = "17fa06310c6256253ef3474cb4694346222b4bca85a53aec7f796a73d18e7082" dependencies = [ "accesskit", + "immutable-chunkmap", ] [[package]] name = "accesskit_macos" -version = "0.10.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" +checksum = "46a3c2a5bb8b5e403502faff2bbb85de5c14bb822a0ba7e9561cb5229b42a176" dependencies = [ "accesskit", "accesskit_consumer", - "objc2 0.3.0-beta.3.patch-leaks.3", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", ] [[package]] name = "accesskit_unix" -version = "0.6.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8c9b4467d77cacfbc93cee9aa8e7822f6d527c774efdca5f8b3a5280c34847" +checksum = "f8b8bfe5d626a7a0ae929df970857b3738198c66dfbf27a8d60d199e29bf2836" dependencies = [ "accesskit", - "accesskit_consumer", - "async-channel", - "async-once-cell", + "accesskit_atspi_common", + "async-channel 2.3.1", + "async-executor", + "async-task", "atspi", "futures-lite", - "once_cell", + "futures-util", "serde", "zbus", ] [[package]] name = "accesskit_windows" -version = "0.15.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" +checksum = "f2ab7baf1a8adacddc2c5a4f14d1f936f73a0f0e1c6d4592514992c4d4c57743" 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.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284218aca17d9e150164428a0ebc7b955f70e3a9a78b4c20894513aabf98a67" +checksum = "9e8201853811d37a43c4753753d89d86802913be12496e5d77c1a418f7f2eaac" dependencies = [ "accesskit", "accesskit_macos", "accesskit_unix", "accesskit_windows", + "raw-window-handle 0.6.2", "winit", ] @@ -139,9 +157,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-activity" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052ad56e336bcc615a214bffbeca6c181ee9550acec193f0327e0b103b033a4d" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", "bitflags 2.5.0", @@ -153,7 +171,7 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror", ] @@ -205,7 +223,7 @@ checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" dependencies = [ "clipboard-win", "log", - "objc2 0.5.1", + "objc2", "objc2-app-kit", "objc2-foundation", "parking_lot", @@ -260,6 +278,18 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" version = "1.5.3" @@ -315,12 +345,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" @@ -532,51 +556,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", -] - -[[package]] -name = "block2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" -dependencies = [ - "block-sys 0.2.0", - "objc2 0.4.1", -] - -[[package]] -name = "block2" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ff7d91d3c1d568065b06c899777d1e48dcf76103a672a0adbc238a7f247f1e" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2 0.5.1", + "objc2", ] [[package]] @@ -585,7 +571,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", @@ -713,6 +699,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cgl" version = "0.3.2" @@ -868,9 +860,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", ] @@ -1163,6 +1155,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" @@ -1193,22 +1191,21 @@ dependencies = [ "image", "js-sys", "log", - "objc2 0.5.1", + "objc2", "objc2-app-kit", "objc2-foundation", "parking_lot", "percent-encoding", "pollster", "puffin", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "ron", "serde", "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "web-time", + "web-time 0.2.0", "wgpu", "winapi", "winit", @@ -1244,7 +1241,7 @@ dependencies = [ "puffin", "thiserror", "type-map", - "web-time", + "web-time 0.2.0", "wgpu", "winit", ] @@ -1260,10 +1257,10 @@ dependencies = [ "egui", "log", "puffin", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "serde", "smithay-clipboard", - "web-time", + "web-time 0.2.0", "webbrowser", "winit", ] @@ -1342,7 +1339,7 @@ dependencies = [ "log", "memoffset 0.9.0", "puffin", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "wasm-bindgen", "web-sys", "winit", @@ -1523,6 +1520,27 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +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.1", + "pin-project-lite", +] + [[package]] name = "fancy-regex" version = "0.11.0" @@ -1651,6 +1669,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" @@ -1671,6 +1700,7 @@ checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1804,55 +1834,56 @@ dependencies = [ [[package]] name = "glutin" -version = "0.31.2" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005459a22af86adc706522d78d360101118e2638ec21df3852fcc626e0dbb212" +checksum = "2491aa3090f682ddd920b184491844440fdd14379c7eef8f5bc10ef7fb3242fd" dependencies = [ "bitflags 2.5.0", - "cfg_aliases", + "cfg_aliases 0.2.1", "cgl", "core-foundation", "dispatch", "glutin_egl_sys", "glutin_glx_sys", - "glutin_wgl_sys", - "icrate", + "glutin_wgl_sys 0.6.0", "libloading 0.8.0", - "objc2 0.4.1", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "wayland-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", "x11-dl", ] [[package]] name = "glutin-winit" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" +checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "glutin", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "winit", ] [[package]] name = "glutin_egl_sys" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77cc5623f5309ef433c3dd4ca1223195347fe62c413da8e2fdd0eb76db2d9bcd" +checksum = "cae99fff4d2850dbe6fb8c1fa8e4fead5525bab715beaacfccf3fb994e01c827" dependencies = [ "gl_generator", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "glutin_glx_sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a165fd686c10dcc2d45380b35796e577eacfd43d4660ee741ec8ebe2201b3b4f" +checksum = "9c2b2d3918e76e18e08796b55eb64e8fe6ec67d5a6b2e2a7e2edce224ad24c63" dependencies = [ "gl_generator", "x11-dl", @@ -1867,6 +1898,15 @@ dependencies = [ "gl_generator", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" +dependencies = [ + "gl_generator", +] + [[package]] name = "gobject-sys" version = "0.18.0" @@ -2055,7 +2095,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -2067,17 +2107,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icrate" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" -dependencies = [ - "block2 0.3.0", - "dispatch", - "objc2 0.4.1", -] - [[package]] name = "idna" version = "0.4.0" @@ -2120,6 +2149,15 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "immutable-chunkmap" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4419f022e55cc63d5bbd6b44b71e1d226b9c9480a47824c706e9d54e5c40c5eb" +dependencies = [ + "arrayvec", +] + [[package]] name = "indexmap" version = "2.1.0" @@ -2276,6 +2314,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" @@ -2454,17 +2503,16 @@ dependencies = [ [[package]] name = "ndk" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ "bitflags 2.5.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "thiserror", ] @@ -2483,6 +2531,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" @@ -2563,99 +2620,205 @@ dependencies = [ [[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" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ - "block2 0.2.0-alpha.6", - "objc-sys 0.2.0-beta.2", - "objc2-encode 2.0.0-pre.2", + "objc-sys", + "objc2-encode", ] [[package]] -name = "objc2" -version = "0.4.1" +name = "objc2-app-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "objc-sys 0.3.3", - "objc2-encode 3.0.0", + "bitflags 2.5.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] -name = "objc2" -version = "0.5.1" +name = "objc2-cloud-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b25e1034d0e636cd84707ccdaa9f81243d399196b8a773946dcffec0401659" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "objc-sys 0.3.3", - "objc2-encode 4.0.1", + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] -name = "objc2-app-kit" -version = "0.2.0" +name = "objc2-contacts" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb79768a710a9a1798848179edb186d1af7e8a8679f369e4b8d201dd2a034047" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", - "objc2-core-data", + "block2", + "objc2", "objc2-foundation", ] [[package]] name = "objc2-core-data" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e092bc42eaf30a08844e6a076938c60751225ec81431ab89f5d1ccd9f958d6c" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", + "bitflags 2.5.0", + "block2", + "objc2", "objc2-foundation", ] [[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" +name = "objc2-core-image" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "objc-sys 0.2.0-beta.2", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", ] [[package]] -name = "objc2-encode" -version = "3.0.0" +name = "objc2-core-location" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] [[package]] name = "objc2-encode" -version = "4.0.1" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88658da63e4cc2c8adb1262902cd6af51094df0488b760d6fd27194269c0950a" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" [[package]] name = "objc2-foundation" -version = "0.2.0" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.5.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "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", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaefe14254871ea16c7d88968c0ff14ba554712a20d76421eec52f0a7fb8904" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] @@ -2696,11 +2859,11 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[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]] @@ -2781,6 +2944,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" @@ -3030,9 +3213,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "raw-window-handle" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rayon" @@ -3078,6 +3261,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" @@ -3323,9 +3515,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", @@ -3806,11 +3998,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", @@ -3818,9 +4009,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", @@ -3829,9 +4020,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", ] @@ -4236,6 +4427,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" @@ -4273,14 +4474,14 @@ checksum = "90e37c7b9921b75dfd26dd973fdcbce36f13dfa6e2dc82aece584e0ed48c355c" dependencies = [ "arrayvec", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "document-features", "js-sys", "log", "naga", "parking_lot", "profiling", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -4300,7 +4501,7 @@ dependencies = [ "arrayvec", "bit-vec", "bitflags 2.5.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "codespan-reporting", "document-features", "indexmap", @@ -4309,7 +4510,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "rustc-hash", "smallvec", "thiserror", @@ -4329,10 +4530,10 @@ dependencies = [ "ash", "bitflags 2.5.0", "block", - "cfg_aliases", + "cfg_aliases 0.1.1", "core-graphics-types", "glow", - "glutin_wgl_sys", + "glutin_wgl_sys 0.5.0", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -4344,12 +4545,12 @@ dependencies = [ "log", "metal", "naga", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.0", + "raw-window-handle 0.6.2", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4410,23 +4611,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]] @@ -4438,26 +4640,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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] @@ -4667,38 +4888,41 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" -version = "0.29.10" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +checksum = "49f45a7b7e2de6af35448d7718dab6d95acec466eb3bb7a56f4d31d1af754004" dependencies = [ "ahash", "android-activity", "atomic-waker", "bitflags 2.5.0", + "block2", "bytemuck", "calloop", - "cfg_aliases", + "cfg_aliases 0.2.1", + "concurrent-queue", "core-foundation", "core-graphics", "cursor-icon", - "icrate", + "dpi", "js-sys", "libc", - "log", "memmap2", "ndk", - "ndk-sys", - "objc2 0.4.1", - "once_cell", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", "orbclient", "percent-encoding", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.0", - "redox_syscall 0.3.5", + "pin-project", + "raw-window-handle 0.6.2", + "redox_syscall 0.4.1", "rustix 0.38.21", "sctk-adwaita", "smithay-client-toolkit", "smol_str", + "tracing", "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", @@ -4707,8 +4931,8 @@ dependencies = [ "wayland-protocols", "wayland-protocols-plasma", "web-sys", - "web-time", - "windows-sys 0.48.0", + "web-time 1.1.0", + "windows-sys 0.52.0", "x11-dl", "x11rb", "xkbcommon-dl", @@ -4776,9 +5000,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 4f2a533377f..c06abd09e60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,8 +75,8 @@ bytemuck = "1.7.2" criterion = { version = "0.5.1", default-features = false } document-features = " 0.2.8" glow = "0.13" -glutin = "0.31" -glutin-winit = "0.4" +glutin = "0.32.0" +glutin-winit = "0.5.0" image = { version = "0.25", default-features = false } log = { version = "0.4", features = ["std"] } nohash-hasher = "0.2" @@ -84,18 +84,18 @@ parking_lot = "0.12" puffin = "0.19" puffin_http = "0.16" ron = "0.8" -raw-window-handle = "0.6.0" +raw-window-handle = "0.6.2" serde = { version = "1", features = ["derive"] } thiserror = "1.0.37" web-time = "0.2" # Timekeeping for native and web wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = "0.3.58" -wgpu = { version = "0.20.0", default-features = false, features = [ +wgpu = { version = "0.20.1", 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.3", default-features = false } [workspace.lints.rust] diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index bb244b38782..bb45a57b7c6 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -59,14 +59,7 @@ android-native-activity = ["egui-winit/android-native-activity"] default_fonts = ["egui/default_fonts"] ## Use [`glow`](https://github.com/grovesNL/glow) for painting, via [`egui_glow`](https://github.com/emilk/egui/tree/master/crates/egui_glow). -glow = [ - "dep:egui_glow", - "dep:glow", - "dep:glutin-winit", - "dep:glutin", - "dep:rwh_05", - "winit/rwh_05", -] +glow = ["dep:egui_glow", "dep:glow", "dep:glutin-winit", "dep:glutin"] ## Enable saving app state to disk. persistence = [ @@ -142,7 +135,7 @@ web-time.workspace = true egui_glow = { workspace = true, optional = true, default-features = false } glow = { workspace = true, optional = true } # glutin stuck on old version of raw-window-handle: -rwh_05 = { package = "raw-window-handle", version = "0.5.2", optional = true, features = [ +rwh_06 = { package = "raw-window-handle", version = "0.6.2", optional = true, features = [ "std", ] } ron = { workspace = true, optional = true, features = ["integer128"] } diff --git a/crates/eframe/src/epi.rs b/crates/eframe/src/epi.rs index 4a05c97aaf2..d8c3b4bed95 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; /// 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 46ad66817ae..1992189b1fb 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -3,7 +3,7 @@ use web_time::Instant; use std::path::PathBuf; -use winit::event_loop::EventLoopWindowTarget; +use winit::event_loop::ActiveEventLoop; use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _}; @@ -12,9 +12,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 { @@ -95,10 +95,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; @@ -232,7 +229,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, diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index 67fcd71471a..c1ca053445b 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -21,8 +21,9 @@ use glutin::{ prelude::{GlDisplay, PossiblyCurrentGlContext}, surface::GlSurface, }; +use raw_window_handle::HasWindowHandle; use winit::{ - event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget}, + event_loop::{ActiveEventLoop, EventLoop, EventLoopProxy}, window::{Window, WindowId}, }; @@ -145,7 +146,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 +190,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 = if let Some(file) = &self.native_options.persistence_path { @@ -325,7 +323,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()) { @@ -396,7 +394,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 { @@ -408,7 +406,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)); @@ -476,7 +474,10 @@ impl WinitApp for GlowWinitApp { #[cfg(feature = "accesskit")] winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest( - accesskit_winit::ActionRequestEvent { request, window_id }, + accesskit_winit::Event { + window_id, + window_event: accesskit_winit::WindowEvent::ActionRequested(request), + }, )) => { if let Some(running) = &self.running { let mut glutin = running.glutin.borrow_mut(); @@ -503,7 +504,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!(); @@ -898,7 +899,7 @@ impl GlutinWindowContext { egui_ctx: &egui::Context, viewport_builder: ViewportBuilder, native_options: &NativeOptions, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, ) -> Result { crate::profile_function!(); @@ -947,7 +948,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_attributes(Some(egui_winit::create_winit_window_builder( egui_ctx, event_loop, viewport_builder.clone(), @@ -983,8 +984,11 @@ impl GlutinWindowContext { gl_display.supported_features() ); let glutin_raw_window_handle = window.as_ref().map(|w| { - use rwh_05::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle - w.raw_window_handle() + //use rwh_06::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle + //w.raw_window_handle() + w.window_handle() + .expect("failed to get window handle") + .as_raw() }); log::debug!("creating gl context using raw window handle: {glutin_raw_window_handle:?}"); @@ -1070,7 +1074,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(); @@ -1087,7 +1091,7 @@ impl GlutinWindowContext { pub(crate) fn initialize_window( &mut self, viewport_id: ViewportId, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, ) -> Result<()> { crate::profile_function!(); @@ -1140,9 +1144,17 @@ impl GlutinWindowContext { let width_px = NonZeroU32::new(width_px).unwrap_or(NonZeroU32::MIN); let height_px = NonZeroU32::new(height_px).unwrap_or(NonZeroU32::MIN); let surface_attributes = { - use rwh_05::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle + //use rwh_06::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle glutin::surface::SurfaceAttributesBuilder::::new() - .build(window.raw_window_handle(), width_px, height_px) + .build( + //window.raw_window_handle(), + window + .window_handle() + .expect("failed to get window handle") + .as_raw(), + width_px, + height_px, + ) }; log::trace!("creating surface with attributes: {surface_attributes:?}"); @@ -1253,7 +1265,7 @@ impl GlutinWindowContext { fn handle_viewport_output( &mut self, - event_loop: &EventLoopWindowTarget, + event_loop: &ActiveEventLoop, egui_ctx: &egui::Context, viewport_output: &ViewportIdMap, ) { @@ -1375,7 +1387,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 7087ed6ae71..9757fa19917 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::EventLoopBuilder::default(); 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 5b9785fc9f5..57dbfc79565 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}, }; @@ -119,7 +119,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; }; @@ -178,7 +178,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 +310,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 +376,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 +390,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)); @@ -478,7 +478,10 @@ impl WinitApp for WgpuWinitApp { #[cfg(feature = "accesskit")] winit::event::Event::UserEvent(UserEvent::AccessKitActionRequest( - accesskit_winit::ActionRequestEvent { request, window_id }, + accesskit_winit::Event { + window_id, + window_event: accesskit_winit::WindowEvent::ActionRequested(request), + }, )) => { if let Some(running) = &mut self.running { let mut shared_lock = running.shared.borrow_mut(); @@ -864,7 +867,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, @@ -909,7 +912,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> { @@ -930,7 +933,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..b08b31074c1 100644 --- a/crates/eframe/src/native/winit_integration.rs +++ b/crates/eframe/src/native/winit_integration.rs @@ -1,7 +1,7 @@ use std::{sync::Arc, time::Instant}; use winit::{ - event_loop::EventLoopWindowTarget, + event_loop::ActiveEventLoop, window::{Window, WindowId}, }; @@ -48,12 +48,22 @@ pub enum UserEvent { /// A request related to [`accesskit`](https://accesskit.dev/). #[cfg(feature = "accesskit")] - AccessKitActionRequest(accesskit_winit::ActionRequestEvent), + AccessKitActionRequest(accesskit_winit::Event), +} + +impl Default for UserEvent { + fn default() -> Self { + UserEvent::RequestRepaint { + viewport_id: ViewportId::default(), + when: Instant::now(), + frame_nr: 0u64, + } + } } #[cfg(feature = "accesskit")] -impl From for UserEvent { - fn from(inner: accesskit_winit::ActionRequestEvent) -> Self { +impl From for UserEvent { + fn from(inner: accesskit_winit::Event) -> Self { Self::AccessKitActionRequest(inner) } } @@ -70,13 +80,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; } diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index 0cf9bf9403a..7c073c14832 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -69,7 +69,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.21.1", 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 4854cd2fd68..9ab0211d70a 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::ElementState, - event_loop::EventLoopWindowTarget, + //event_loop::EventLoopWindowTarget, window::{CursorGrabMode, Window, WindowButtons, WindowLevel}, }; @@ -158,18 +158,22 @@ impl State { } #[cfg(feature = "accesskit")] - pub fn init_accesskit + Send>( + pub fn init_accesskit + Send>( &mut self, window: &Window, event_loop_proxy: winit::event_loop::EventLoopProxy, initial_tree_update_factory: impl 'static + FnOnce() -> accesskit::TreeUpdate + Send, ) { crate::profile_function!(); - self.accesskit = Some(accesskit_winit::Adapter::new( + self.accesskit = Some(accesskit_winit::Adapter::with_event_loop_proxy( window, - initial_tree_update_factory, event_loop_proxy, )); + //self.accesskit = Some(accesskit_winit::Adapter::new( + // window, + // initial_tree_update_factory, + // event_loop_proxy, + //)); } /// Call this once a graphics context has been created to update the maximum texture dimensions @@ -263,7 +267,7 @@ impl State { crate::profile_function!(short_window_event_description(event)); #[cfg(feature = "accesskit")] - if let Some(accesskit) = &self.accesskit { + if let Some(accesskit) = self.accesskit.as_mut() { accesskit.process_event(window, event); } @@ -474,13 +478,14 @@ impl State { // Things we completely ignore: WindowEvent::ActivationTokenDone { .. } | WindowEvent::AxisMotion { .. } - | WindowEvent::SmartMagnify { .. } - | WindowEvent::TouchpadRotate { .. } => EventResponse { + | WindowEvent::DoubleTapGesture { .. } + | WindowEvent::RotationGesture { .. } + | WindowEvent::PanGesture { .. } => 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(); @@ -859,7 +864,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); @@ -1510,28 +1515,34 @@ fn process_viewport_command( /// /// # 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: &EventLoopWindowTarget, + event_loop: &winit::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 = { - crate::profile_scope!("WindowBuilder::build"); - window_builder.build(event_loop)? - }; + //let window = { + // crate::profile_scope!("WindowBuilder::build"); + // window_builder.build(event_loop)? + //}; + let window = event_loop + .create_window(window_builder) + .expect("failed to create window"); apply_viewport_builder_to_window(egui_ctx, &window, viewport_builder); Ok(window) } -pub fn create_winit_window_builder( +pub fn create_winit_window_builder( egui_ctx: &egui::Context, - event_loop: &EventLoopWindowTarget, + //event_loop: &EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, viewport_builder: ViewportBuilder, -) -> winit::window::WindowBuilder { + //) -> 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 @@ -1590,7 +1601,8 @@ 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_builder = winit::window::WindowAttributes::default() + //let mut window_builder = winit::window::WindowBuilder::new() .with_title(title.unwrap_or_else(|| "egui window".to_owned())) .with_transparent(transparent.unwrap_or(false)) .with_decorations(decorations.unwrap_or(true)) @@ -1685,7 +1697,8 @@ pub fn create_winit_window_builder( #[cfg(target_os = "windows")] { - use winit::platform::windows::WindowBuilderExtWindows as _; + use winit::platform::windows::WindowAttributesExtWindows as _; + //use winit::platform::windows::WindowBuilderExtWindows as _; if let Some(enable) = _drag_and_drop { window_builder = window_builder.with_drag_and_drop(enable); } @@ -1828,16 +1841,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::TouchpadMagnify", WindowEvent::RedrawRequested { .. } => "WindowEvent::RedrawRequested", - WindowEvent::SmartMagnify { .. } => "WindowEvent::SmartMagnify", - WindowEvent::TouchpadRotate { .. } => "WindowEvent::TouchpadRotate", + WindowEvent::DoubleTapGesture { .. } => "WindowEvent::SmartMagnify", + WindowEvent::RotationGesture { .. } => "WindowEvent::TouchpadRotate", 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 ec633d3df0a..627d88158c0 100644 --- a/crates/egui-winit/src/window_settings.rs +++ b/crates/egui-winit/src/window_settings.rs @@ -50,10 +50,10 @@ impl WindowSettings { self.inner_size_points } - pub fn initialize_viewport_builder( + pub fn initialize_viewport_builder( &self, egui_zoom_factor: f32, - event_loop: &winit::event_loop::EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, mut viewport_builder: ViewportBuilder, ) -> ViewportBuilder { crate::profile_function!(); @@ -110,10 +110,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. @@ -137,9 +137,9 @@ impl WindowSettings { } } -fn find_active_monitor( +fn find_active_monitor( egui_zoom_factor: f32, - event_loop: &winit::event_loop::EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, window_size_pts: egui::Vec2, position_px: &egui::Pos2, ) -> Option { @@ -172,9 +172,9 @@ fn find_active_monitor( Some(active_monitor) } -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 2e8e1ddd557..470e2b0e70c 100644 --- a/crates/egui/Cargo.toml +++ b/crates/egui/Cargo.toml @@ -86,7 +86,7 @@ ahash.workspace = true nohash-hasher.workspace = true #! ### Optional dependencies -accesskit = { version = "0.12", optional = true } +accesskit = { version = "0.15", optional = true } backtrace = { workspace = true, optional = true } diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index a02e19c467c..79b4728a3ea 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -392,9 +392,8 @@ struct ContextImpl { #[cfg(feature = "accesskit")] is_accesskit_enabled: bool, - #[cfg(feature = "accesskit")] - accesskit_node_classes: accesskit::NodeClassSet, - + //#[cfg(feature = "accesskit")] + //accesskit_node_classes: accesskit::NodeClassSet, loaders: Arc, } @@ -1985,12 +1984,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 @@ -2906,10 +2900,7 @@ impl Context { 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), - )], + 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 192c573ff16..5c02c6e9e50 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -894,7 +894,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 { @@ -906,7 +906,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, @@ -924,14 +924,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/Cargo.toml b/crates/egui_glow/Cargo.toml index 28de667e8c1..147f6fa1701 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -83,7 +83,7 @@ wasm-bindgen.workspace = true glutin.workspace = true # examples/pure_glow glutin-winit.workspace = true # glutin stuck on old version of raw-window-handle: -rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [ +rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = [ "std", ] } diff --git a/crates/egui_glow/examples/pure_glow.rs b/crates/egui_glow/examples/pure_glow.rs index 70f07421475..32567d689d2 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_builder = 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_builder.clone())) .build( event_loop, config_template_builder, diff --git a/crates/egui_glow/src/winit.rs b/crates/egui_glow/src/winit.rs index a9bec5fd039..139d1de52ea 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, From c283ce635e8fd5b6a812b19645691b7ed73dc311 Mon Sep 17 00:00:00 2001 From: josef Date: Tue, 25 Jun 2024 04:39:02 +0200 Subject: [PATCH 2/6] cleanup --- crates/eframe/src/native/glow_integration.rs | 9 ++++---- crates/egui-winit/src/lib.rs | 23 ++++---------------- crates/egui/src/context.rs | 3 +-- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index c1ca053445b..990aaa0d83d 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -948,7 +948,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_attributes(Some(egui_winit::create_winit_window_builder( + .with_window_attributes(Some(egui_winit::create_winit_window_attributes( egui_ctx, event_loop, viewport_builder.clone(), @@ -1104,17 +1104,18 @@ impl GlutinWindowContext { window } else { log::debug!("Creating a window for viewport {viewport_id:?}"); - let window_builder = egui_winit::create_winit_window_builder( + let window_attributes = egui_winit::create_winit_window_attributes( &self.egui_ctx, event_loop, viewport.builder.clone(), ); - if window_builder.transparent() && self.gl_config.supports_transparency() == Some(false) + if window_attributes.transparent() + && self.gl_config.supports_transparency() == Some(false) { log::error!("Cannot create transparent window: the GL config does not support it"); } let window = - glutin_winit::finalize_window(event_loop, window_builder, &self.gl_config)?; + glutin_winit::finalize_window(event_loop, window_attributes, &self.gl_config)?; egui_winit::apply_viewport_builder_to_window( &self.egui_ctx, &window, diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 9ab0211d70a..c572bc36cf3 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -31,7 +31,6 @@ pub(crate) use profiling_scopes::*; use winit::{ dpi::{PhysicalPosition, PhysicalSize}, event::ElementState, - //event_loop::EventLoopWindowTarget, window::{CursorGrabMode, Window, WindowButtons, WindowLevel}, }; @@ -169,11 +168,6 @@ impl State { window, event_loop_proxy, )); - //self.accesskit = Some(accesskit_winit::Adapter::new( - // window, - // initial_tree_update_factory, - // event_loop_proxy, - //)); } /// Call this once a graphics context has been created to update the maximum texture dimensions @@ -1517,31 +1511,24 @@ fn process_viewport_command( /// Possible causes of error include denied permission, incompatible system, and lack of memory. pub fn create_window( egui_ctx: &egui::Context, - //event_loop: &EventLoopWindowTarget, event_loop: &winit::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 = { - // crate::profile_scope!("WindowBuilder::build"); - // window_builder.build(event_loop)? - //}; + let window_attributes = + create_winit_window_attributes(egui_ctx, event_loop, viewport_builder.clone()); let window = event_loop - .create_window(window_builder) + .create_window(window_attributes) .expect("failed to create window"); 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: &winit::event_loop::ActiveEventLoop, viewport_builder: ViewportBuilder, - //) -> winit::window::WindowBuilder { ) -> winit::window::WindowAttributes { crate::profile_function!(); @@ -1602,7 +1589,6 @@ pub fn create_winit_window_builder( } = viewport_builder; let mut window_builder = winit::window::WindowAttributes::default() - //let mut window_builder = winit::window::WindowBuilder::new() .with_title(title.unwrap_or_else(|| "egui window".to_owned())) .with_transparent(transparent.unwrap_or(false)) .with_decorations(decorations.unwrap_or(true)) @@ -1698,7 +1684,6 @@ pub fn create_winit_window_builder( #[cfg(target_os = "windows")] { use winit::platform::windows::WindowAttributesExtWindows as _; - //use winit::platform::windows::WindowBuilderExtWindows as _; if let Some(enable) = _drag_and_drop { window_builder = window_builder.with_drag_and_drop(enable); } diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 79b4728a3ea..d7fb8e67c5c 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -392,8 +392,7 @@ struct ContextImpl { #[cfg(feature = "accesskit")] is_accesskit_enabled: bool, - //#[cfg(feature = "accesskit")] - //accesskit_node_classes: accesskit::NodeClassSet, + loaders: Arc, } From f6e5d00587b2d2e37776d8f7aeae49d2a29f8b53 Mon Sep 17 00:00:00 2001 From: josef Date: Sat, 29 Jun 2024 02:52:57 +0200 Subject: [PATCH 3/6] fix errors in egui_glow caused by updating to winit 0.30 --- crates/eframe/Cargo.toml | 6 +- crates/eframe/src/native/glow_integration.rs | 4 - crates/egui_glow/Cargo.toml | 9 +- crates/egui_glow/examples/pure_glow.rs | 217 ++++++++++++------- 4 files changed, 149 insertions(+), 87 deletions(-) diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index bb45a57b7c6..b152353b58b 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -135,9 +135,9 @@ web-time.workspace = true egui_glow = { workspace = true, optional = true, default-features = false } glow = { workspace = true, optional = true } # glutin stuck on old version of raw-window-handle: -rwh_06 = { package = "raw-window-handle", version = "0.6.2", optional = true, features = [ - "std", -] } +#rwh_06 = { package = "raw-window-handle", version = "0.6.2", optional = true, features = [ +# "std", +#] } ron = { workspace = true, optional = true, features = ["integer128"] } serde = { workspace = true, optional = true } diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index 990aaa0d83d..6e97acd8c73 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -984,8 +984,6 @@ impl GlutinWindowContext { gl_display.supported_features() ); let glutin_raw_window_handle = window.as_ref().map(|w| { - //use rwh_06::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle - //w.raw_window_handle() w.window_handle() .expect("failed to get window handle") .as_raw() @@ -1145,10 +1143,8 @@ impl GlutinWindowContext { let width_px = NonZeroU32::new(width_px).unwrap_or(NonZeroU32::MIN); let height_px = NonZeroU32::new(height_px).unwrap_or(NonZeroU32::MIN); let surface_attributes = { - //use rwh_06::HasRawWindowHandle as _; // glutin stuck on old version of raw-window-handle glutin::surface::SurfaceAttributesBuilder::::new() .build( - //window.raw_window_handle(), window .window_handle() .expect("failed to get window handle") diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index 147f6fa1701..e832d1325ab 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -56,6 +56,7 @@ x11 = ["winit?/x11"] egui = { workspace = true, default-features = false, features = ["bytemuck"] } egui-winit = { workspace = true, optional = true, default-features = false } +raw-window-handle.workspace = true ahash.workspace = true bytemuck.workspace = true glow.workspace = true @@ -83,14 +84,14 @@ wasm-bindgen.workspace = true glutin.workspace = true # examples/pure_glow glutin-winit.workspace = true # glutin stuck on old version of raw-window-handle: -rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = [ - "std", -] } +#rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = [ +# "std", +#] } [[example]] name = "pure_glow" required-features = [ "winit", "egui/default_fonts", - "winit/rwh_05", # glutin stuck on old version of raw-window-handle + "winit/rwh_06", # glutin stuck on old version of raw-window-handle ] diff --git a/crates/egui_glow/examples/pure_glow.rs b/crates/egui_glow/examples/pure_glow.rs index 32567d689d2..46c56aca19a 100644 --- a/crates/egui_glow/examples/pure_glow.rs +++ b/crates/egui_glow/examples/pure_glow.rs @@ -8,8 +8,10 @@ #![allow(unsafe_code)] use std::num::NonZeroU32; +use std::sync::Arc; use egui_winit::winit; +use raw_window_handle::HasWindowHandle; /// The majority of `GlutinWindowContext` is taken from `eframe` struct GlutinWindowContext { @@ -28,7 +30,6 @@ impl GlutinWindowContext { use glutin::display::GetGlDisplay; use glutin::display::GlDisplay; use glutin::prelude::GlSurface; - use rwh_05::HasRawWindowHandle; let winit_window_builder = winit::window::WindowAttributes::default() .with_resizable(true) .with_inner_size(winit::dpi::LogicalSize { @@ -62,7 +63,11 @@ impl GlutinWindowContext { let gl_display = gl_config.display(); log::debug!("found gl_config: {:?}", &gl_config); - let raw_window_handle = window.as_ref().map(|w| w.raw_window_handle()); + let raw_window_handle = window.as_ref().map(|w| { + w.window_handle() + .expect("failed to get window handle") + .as_raw() + }); log::debug!("raw window handle: {:?}", raw_window_handle); let context_attributes = glutin::context::ContextAttributesBuilder::new().build(raw_window_handle); @@ -95,7 +100,14 @@ impl GlutinWindowContext { let height = NonZeroU32::new(height).unwrap_or(NonZeroU32::MIN); let surface_attributes = glutin::surface::SurfaceAttributesBuilder::::new() - .build(window.raw_window_handle(), width, height); + .build( + window + .window_handle() + .expect("failed to get window handle") + .as_raw(), + width, + height, + ); log::debug!( "creating surface with attributes: {:?}", &surface_attributes @@ -152,51 +164,81 @@ pub enum UserEvent { Redraw(std::time::Duration), } -fn main() { - let mut clear_color = [0.1, 0.1, 0.1]; +struct GlowApp { + proxy: winit::event_loop::EventLoopProxy, + gl_window: Option, + gl: Option>, + egui_glow: Option, + repaint_delay: std::time::Duration, + clear_color: [f32; 3], +} - let event_loop = winit::event_loop::EventLoopBuilder::::with_user_event() - .build() - .unwrap(); - let (gl_window, gl) = create_display(&event_loop); - let gl = std::sync::Arc::new(gl); - - let mut egui_glow = egui_glow::EguiGlow::new(&event_loop, gl.clone(), None, None); - - let event_loop_proxy = egui::mutex::Mutex::new(event_loop.create_proxy()); - egui_glow - .egui_ctx - .set_request_repaint_callback(move |info| { - event_loop_proxy - .lock() - .send_event(UserEvent::Redraw(info.delay)) - .expect("Cannot send event"); - }); +impl GlowApp { + fn new(proxy: winit::event_loop::EventLoopProxy) -> Self { + Self { + proxy, + gl_window: None, + gl: None, + egui_glow: None, + repaint_delay: std::time::Duration::MAX, + clear_color: [0.1, 0.1, 0.1], + } + } +} - let mut repaint_delay = std::time::Duration::MAX; +impl winit::application::ApplicationHandler for GlowApp { + fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { + let (gl_window, gl) = create_display(event_loop); + let gl = std::sync::Arc::new(gl); + gl_window.window().set_visible(true); + + let egui_glow = egui_glow::EguiGlow::new(event_loop, gl.clone(), None, None); + + let event_loop_proxy = egui::mutex::Mutex::new(self.proxy.clone()); + egui_glow + .egui_ctx + .set_request_repaint_callback(move |info| { + event_loop_proxy + .lock() + .send_event(UserEvent::Redraw(info.delay)) + .expect("Cannot send event"); + }); + self.gl_window = Some(gl_window); + self.gl = Some(gl); + self.egui_glow = Some(egui_glow); + } - let _ = event_loop.run(move |event, event_loop_window_target| { + fn window_event( + &mut self, + event_loop: &winit::event_loop::ActiveEventLoop, + _window_id: winit::window::WindowId, + event: winit::event::WindowEvent, + ) { let mut redraw = || { let mut quit = false; - egui_glow.run(gl_window.window(), |egui_ctx| { - egui::SidePanel::left("my_side_panel").show(egui_ctx, |ui| { - ui.heading("Hello World!"); - if ui.button("Quit").clicked() { - quit = true; - } - ui.color_edit_button_rgb(&mut clear_color); - }); - }); + self.egui_glow.as_mut().unwrap().run( + self.gl_window.as_mut().unwrap().window(), + |egui_ctx| { + egui::SidePanel::left("my_side_panel").show(egui_ctx, |ui| { + ui.heading("Hello World!"); + if ui.button("Quit").clicked() { + quit = true; + } + + ui.color_edit_button_rgb(self.clear_color.as_mut().try_into().unwrap()); + }); + }, + ); if quit { - event_loop_window_target.exit(); + event_loop.exit(); } else { - event_loop_window_target.set_control_flow(if repaint_delay.is_zero() { - gl_window.window().request_redraw(); + event_loop.set_control_flow(if self.repaint_delay.is_zero() { + self.gl_window.as_mut().unwrap().window().request_redraw(); winit::event_loop::ControlFlow::Poll } else if let Some(repaint_after_instant) = - std::time::Instant::now().checked_add(repaint_delay) + std::time::Instant::now().checked_add(self.repaint_delay) { winit::event_loop::ControlFlow::WaitUntil(repaint_after_instant) } else { @@ -207,64 +249,87 @@ fn main() { { unsafe { use glow::HasContext as _; - gl.clear_color(clear_color[0], clear_color[1], clear_color[2], 1.0); - gl.clear(glow::COLOR_BUFFER_BIT); + self.gl.as_mut().unwrap().clear_color( + self.clear_color[0], + self.clear_color[1], + self.clear_color[2], + 1.0, + ); + self.gl.as_mut().unwrap().clear(glow::COLOR_BUFFER_BIT); } // draw things behind egui here - egui_glow.paint(gl_window.window()); + self.egui_glow + .as_mut() + .unwrap() + .paint(self.gl_window.as_mut().unwrap().window()); // draw things on top of egui here - gl_window.swap_buffers().unwrap(); - gl_window.window().set_visible(true); + self.gl_window.as_mut().unwrap().swap_buffers().unwrap(); + self.gl_window.as_mut().unwrap().window().set_visible(true); } }; - match event { - winit::event::Event::WindowEvent { event, .. } => { - use winit::event::WindowEvent; - if matches!(event, WindowEvent::CloseRequested | WindowEvent::Destroyed) { - event_loop_window_target.exit(); - return; - } - - if matches!(event, WindowEvent::RedrawRequested) { - redraw(); - return; - } + use winit::event::WindowEvent; + if matches!(event, WindowEvent::CloseRequested | WindowEvent::Destroyed) { + event_loop.exit(); + return; + } - if let winit::event::WindowEvent::Resized(physical_size) = &event { - gl_window.resize(*physical_size); - } + if matches!(event, WindowEvent::RedrawRequested) { + redraw(); + return; + } - let event_response = egui_glow.on_window_event(gl_window.window(), &event); + if let winit::event::WindowEvent::Resized(physical_size) = &event { + self.gl_window.as_mut().unwrap().resize(*physical_size); + } - if event_response.repaint { - gl_window.window().request_redraw(); - } - } + let event_response = self + .egui_glow + .as_mut() + .unwrap() + .on_window_event(self.gl_window.as_mut().unwrap().window(), &event); - winit::event::Event::UserEvent(UserEvent::Redraw(delay)) => { - repaint_delay = delay; - } - winit::event::Event::LoopExiting => { - egui_glow.destroy(); - } - winit::event::Event::NewEvents(winit::event::StartCause::ResumeTimeReached { - .. - }) => { - gl_window.window().request_redraw(); - } + if event_response.repaint { + self.gl_window.as_mut().unwrap().window().request_redraw(); + } + } + fn user_event(&mut self, _event_loop: &winit::event_loop::ActiveEventLoop, event: UserEvent) { + match event { + UserEvent::Redraw(delay) => self.repaint_delay = delay, + } + } - _ => (), + fn new_events( + &mut self, + _event_loop: &winit::event_loop::ActiveEventLoop, + cause: winit::event::StartCause, + ) { + if let winit::event::StartCause::ResumeTimeReached { .. } = &cause { + self.gl_window.as_mut().unwrap().window().request_redraw(); } - }); + } + + fn exiting(&mut self, _event_loop: &winit::event_loop::ActiveEventLoop) { + self.egui_glow.as_mut().unwrap().destroy(); + } +} + +fn main() { + let event_loop = winit::event_loop::EventLoop::::with_user_event() + .build() + .unwrap(); + let proxy = event_loop.create_proxy(); + + let mut app = GlowApp::new(proxy); + event_loop.run_app(&mut app).expect("failed to run app"); } fn create_display( - event_loop: &winit::event_loop::EventLoopWindowTarget, + event_loop: &winit::event_loop::ActiveEventLoop, ) -> (GlutinWindowContext, glow::Context) { let glutin_window_context = unsafe { GlutinWindowContext::new(event_loop) }; let gl = unsafe { From 4b76e82fdf931f415d86958286d82ecfd60bfbb1 Mon Sep 17 00:00:00 2001 From: josef Date: Sat, 29 Jun 2024 05:48:12 +0200 Subject: [PATCH 4/6] togglebutton was removed from accesskit --- crates/egui/tests/accesskit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/tests/accesskit.rs b/crates/egui/tests/accesskit.rs index f68e50b437a..61f8d760704 100644 --- a/crates/egui/tests/accesskit.rs +++ b/crates/egui/tests/accesskit.rs @@ -90,6 +90,6 @@ fn toggle_button_text() { nodes .iter() - .find(|(_, node)| node.role() == Role::ToggleButton && node.name() == Some(button_text)) + .find(|(_, node)| node.role() == Role::Button && node.name() == Some(button_text)) .expect("Toggle button should exist in the accesskit output"); } From c1f1746d8264b8f87cb4c342a071770c65ec7e0c Mon Sep 17 00:00:00 2001 From: josef Date: Sun, 30 Jun 2024 00:53:08 +0200 Subject: [PATCH 5/6] windowbuilder -> windowattributes on linux, macos --- crates/eframe/src/native/winit_integration.rs | 2 +- crates/egui-winit/src/lib.rs | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/crates/eframe/src/native/winit_integration.rs b/crates/eframe/src/native/winit_integration.rs index b08b31074c1..4f0117ea466 100644 --- a/crates/eframe/src/native/winit_integration.rs +++ b/crates/eframe/src/native/winit_integration.rs @@ -53,7 +53,7 @@ pub enum UserEvent { impl Default for UserEvent { fn default() -> Self { - UserEvent::RequestRepaint { + Self::RequestRepaint { viewport_id: ViewportId::default(), when: Instant::now(), frame_nr: 0u64, diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index c572bc36cf3..f131b397668 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -879,7 +879,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); } @@ -1653,30 +1653,30 @@ pub fn create_winit_window_attributes( #[cfg(all(feature = "wayland", target_os = "linux"))] if let Some(app_id) = _app_id { - use winit::platform::wayland::WindowBuilderExtWayland as _; + use winit::platform::wayland::WindowAttributesExtWayland as _; window_builder = window_builder.with_name(app_id, ""); } #[cfg(all(feature = "x11", target_os = "linux"))] { if let Some(window_type) = _window_type { - use winit::platform::x11::WindowBuilderExtX11 as _; - use winit::platform::x11::XWindowType; + use winit::platform::x11::WindowAttributesExtX11 as _; + use winit::platform::x11::WindowType; window_builder = window_builder.with_x11_window_type(vec![match window_type { - egui::X11WindowType::Normal => XWindowType::Normal, - egui::X11WindowType::Utility => XWindowType::Utility, - egui::X11WindowType::Dock => XWindowType::Dock, - egui::X11WindowType::Desktop => XWindowType::Desktop, - egui::X11WindowType::Toolbar => XWindowType::Toolbar, - egui::X11WindowType::Menu => XWindowType::Menu, - egui::X11WindowType::Splash => XWindowType::Splash, - egui::X11WindowType::Dialog => XWindowType::Dialog, - egui::X11WindowType::DropdownMenu => XWindowType::DropdownMenu, - egui::X11WindowType::PopupMenu => XWindowType::PopupMenu, - egui::X11WindowType::Tooltip => XWindowType::Tooltip, - egui::X11WindowType::Notification => XWindowType::Notification, - egui::X11WindowType::Combo => XWindowType::Combo, - egui::X11WindowType::Dnd => XWindowType::Dnd, + egui::X11WindowType::Normal => WindowType::Normal, + egui::X11WindowType::Utility => WindowType::Utility, + egui::X11WindowType::Dock => WindowType::Dock, + egui::X11WindowType::Desktop => WindowType::Desktop, + egui::X11WindowType::Toolbar => WindowType::Toolbar, + egui::X11WindowType::Menu => WindowType::Menu, + egui::X11WindowType::Splash => WindowType::Splash, + egui::X11WindowType::Dialog => WindowType::Dialog, + egui::X11WindowType::DropdownMenu => WindowType::DropdownMenu, + egui::X11WindowType::PopupMenu => WindowType::PopupMenu, + egui::X11WindowType::Tooltip => WindowType::Tooltip, + egui::X11WindowType::Notification => WindowType::Notification, + egui::X11WindowType::Combo => WindowType::Combo, + egui::X11WindowType::Dnd => WindowType::Dnd, }]); } } @@ -1694,7 +1694,7 @@ pub fn create_winit_window_attributes( #[cfg(target_os = "macos")] { - use winit::platform::macos::WindowBuilderExtMacOS as _; + use winit::platform::macos::WindowAttributesExtMacOS as _; window_builder = window_builder .with_title_hidden(!_title_shown.unwrap_or(true)) .with_titlebar_buttons_hidden(!_titlebar_buttons_shown.unwrap_or(true)) From eb873d5fe50a99c48a448bf56bf071bd61d1c218 Mon Sep 17 00:00:00 2001 From: josef Date: Sun, 30 Jun 2024 00:56:04 +0200 Subject: [PATCH 6/6] rename window_builder to window_attributes --- crates/egui-winit/src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index f131b397668..28c083b4713 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -1588,7 +1588,7 @@ pub fn create_winit_window_attributes( clamp_size_to_monitor_size: _, // Handled in `viewport_builder` in `epi_integration.rs` } = viewport_builder; - let mut window_builder = winit::window::WindowAttributes::default() + 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)) @@ -1619,28 +1619,28 @@ pub fn create_winit_window_attributes( .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, )); @@ -1648,13 +1648,13 @@ pub fn create_winit_window_attributes( 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::WindowAttributesExtWayland as _; - window_builder = window_builder.with_name(app_id, ""); + window_attributes = window_attributes.with_name(app_id, ""); } #[cfg(all(feature = "x11", target_os = "linux"))] @@ -1662,7 +1662,7 @@ pub fn create_winit_window_attributes( if let Some(window_type) = _window_type { use winit::platform::x11::WindowAttributesExtX11 as _; use winit::platform::x11::WindowType; - 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 => WindowType::Normal, egui::X11WindowType::Utility => WindowType::Utility, egui::X11WindowType::Dock => WindowType::Dock, @@ -1685,24 +1685,24 @@ pub fn create_winit_window_attributes( { 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::WindowAttributesExtMacOS 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 {