Upgrade to egui@0.29.1 and winit@0.30.5 (#33751)

* update egui dependencies

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update glow to 0.14.1

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update winit to 0.30.5

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update servo-tidy.toml

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Use more imports to avoid qualified usage, fix build, and silence warnings about deprecated methods

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Gae24 2024-10-10 19:18:03 +02:00 committed by GitHub
parent 6b3a316e1b
commit fd19409f31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 339 additions and 182 deletions

361
Cargo.lock generated
View file

@ -104,9 +104,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "android-activity"
version = "0.5.2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046"
dependencies = [
"android-properties",
"bitflags 2.6.0",
@ -118,7 +118,7 @@ dependencies = [
"log",
"ndk",
"ndk-context",
"ndk-sys",
"ndk-sys 0.6.0+11769913",
"num_enum",
"thiserror",
]
@ -470,22 +470,12 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7"
dependencies = [
"objc-sys",
]
[[package]]
name = "block2"
version = "0.3.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68"
checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"
dependencies = [
"block-sys",
"objc2",
]
@ -638,9 +628,9 @@ dependencies = [
[[package]]
name = "calloop"
version = "0.12.4"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
dependencies = [
"bitflags 2.6.0",
"log",
@ -652,9 +642,9 @@ dependencies = [
[[package]]
name = "calloop-wayland-source"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [
"calloop",
"rustix",
@ -1661,6 +1651,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
[[package]]
name = "dpi"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53"
[[package]]
name = "dtoa"
version = "1.0.9"
@ -1692,9 +1688,9 @@ dependencies = [
[[package]]
name = "ecolor"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e6b451ff1143f6de0f33fc7f1b68fecfd2c7de06e104de96c4514de3f5396f8"
checksum = "775cfde491852059e386c4e1deb4aef381c617dc364184c6f6afee99b87c402b"
dependencies = [
"bytemuck",
"emath",
@ -1702,9 +1698,9 @@ dependencies = [
[[package]]
name = "egui"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20c97e70a2768de630f161bb5392cbd3874fcf72868f14df0e002e82e06cb798"
checksum = "53eafabcce0cb2325a59a98736efe0bf060585b437763f8c476957fb274bb974"
dependencies = [
"ahash",
"emath",
@ -1715,9 +1711,9 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fac4e066af341bf92559f60dbdf2020b2a03c963415349af5f3f8d79ff7a4926"
checksum = "0a9c430f4f816340e8e8c1b20eec274186b1be6bc4c7dfc467ed50d57abc36c6"
dependencies = [
"ahash",
"arboard",
@ -1731,15 +1727,15 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e2bdc8b38cfa17cc712c4ae079e30c71c00cd4c2763c9e16dc7860a02769103"
checksum = "0e39bccc683cd43adab530d8f21a13eb91e80de10bcc38c3f1c16601b6f62b26"
dependencies = [
"ahash",
"bytemuck",
"egui",
"egui-winit",
"glow 0.13.1",
"glow",
"log",
"memoffset",
"wasm-bindgen",
@ -1755,9 +1751,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "emath"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6a21708405ea88f63d8309650b4d77431f4bc28fb9d8e6f77d3963b51249e6"
checksum = "b1fe0049ce51d0fb414d029e668dd72eb30bc2b739bf34296ed97bd33df544f3"
dependencies = [
"bytemuck",
]
@ -1842,20 +1838,27 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.28.1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f0dcc0a0771e7500e94cd1cb797bd13c9f23b9409bdc3c824e2cbc562b7fa01"
checksum = "a32af8da821bd4f43f2c137e295459ee2e1661d87ca8779dfa0eaf45d870e20f"
dependencies = [
"ab_glyph",
"ahash",
"bytemuck",
"ecolor",
"emath",
"epaint_default_fonts",
"log",
"nohash-hasher",
"parking_lot",
]
[[package]]
name = "epaint_default_fonts"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "483440db0b7993cf77a20314f08311dbe95675092405518c0677aa08c151a3ea"
[[package]]
name = "equivalent"
version = "1.0.1"
@ -2482,18 +2485,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "glow"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1"
dependencies = [
"js-sys",
"slotmap",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "glow"
version = "0.14.1"
@ -3178,17 +3169,6 @@ dependencies = [
"cc",
]
[[package]]
name = "icrate"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319"
dependencies = [
"block2",
"dispatch",
"objc2",
]
[[package]]
name = "icu_calendar"
version = "1.5.2"
@ -4631,14 +4611,14 @@ 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.6.0",
"jni-sys",
"log",
"ndk-sys",
"ndk-sys 0.6.0+11769913",
"num_enum",
"raw-window-handle",
"thiserror",
@ -4659,6 +4639,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 = "net"
version = "0.0.1"
@ -4933,19 +4922,200 @@ checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"
[[package]]
name = "objc2"
version = "0.4.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d"
checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804"
dependencies = [
"objc-sys",
"objc2-encode",
]
[[package]]
name = "objc2-encode"
version = "3.0.0"
name = "objc2-app-kit"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666"
checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
dependencies = [
"bitflags 2.6.0",
"block2",
"libc",
"objc2",
"objc2-core-data",
"objc2-core-image",
"objc2-foundation",
"objc2-quartz-core",
]
[[package]]
name = "objc2-cloud-kit"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
dependencies = [
"bitflags 2.6.0",
"block2",
"objc2",
"objc2-core-location",
"objc2-foundation",
]
[[package]]
name = "objc2-contacts"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889"
dependencies = [
"block2",
"objc2",
"objc2-foundation",
]
[[package]]
name = "objc2-core-data"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
dependencies = [
"bitflags 2.6.0",
"block2",
"objc2",
"objc2-foundation",
]
[[package]]
name = "objc2-core-image"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"
dependencies = [
"block2",
"objc2",
"objc2-foundation",
"objc2-metal",
]
[[package]]
name = "objc2-core-location"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781"
dependencies = [
"block2",
"objc2",
"objc2-contacts",
"objc2-foundation",
]
[[package]]
name = "objc2-encode"
version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8"
[[package]]
name = "objc2-foundation"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
dependencies = [
"bitflags 2.6.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.6.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.6.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.6.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 = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
dependencies = [
"bitflags 2.6.0",
"block2",
"objc2",
"objc2-core-location",
"objc2-foundation",
]
[[package]]
name = "objc_exception"
@ -5652,15 +5822,6 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "redox_syscall"
version = "0.4.1"
@ -6069,9 +6230,9 @@ dependencies = [
[[package]]
name = "sctk-adwaita"
version = "0.8.3"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70b31447ca297092c5a9916fc3b955203157b37c19ca8edde4f52e9843e602c7"
checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec"
dependencies = [
"ab_glyph",
"log",
@ -6471,7 +6632,7 @@ dependencies = [
"gilrs",
"gl_generator",
"gleam",
"glow 0.13.1",
"glow",
"headers",
"hilog",
"hitrace",
@ -6640,9 +6801,9 @@ dependencies = [
[[package]]
name = "smithay-client-toolkit"
version = "0.18.1"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
dependencies = [
"bitflags 2.6.0",
"calloop",
@ -6665,9 +6826,9 @@ dependencies = [
[[package]]
name = "smithay-clipboard"
version = "0.7.1"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d"
checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846"
dependencies = [
"libc",
"smithay-client-toolkit",
@ -7898,9 +8059,9 @@ dependencies = [
[[package]]
name = "wayland-protocols"
version = "0.31.2"
version = "0.32.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0"
dependencies = [
"bitflags 2.6.0",
"wayland-backend",
@ -7910,9 +8071,9 @@ dependencies = [
[[package]]
name = "wayland-protocols-plasma"
version = "0.2.0"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
checksum = "8a0a41a6875e585172495f7a96dfa42ca7e0213868f4f15c313f7c33221a7eff"
dependencies = [
"bitflags 2.6.0",
"wayland-backend",
@ -7923,9 +8084,9 @@ dependencies = [
[[package]]
name = "wayland-protocols-wlr"
version = "0.2.0"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
checksum = "dad87b5fd1b1d3ca2f792df8f686a2a11e3fe1077b71096f7a175ab699f89109"
dependencies = [
"bitflags 2.6.0",
"wayland-backend",
@ -7981,9 +8142,9 @@ dependencies = [
[[package]]
name = "web-time"
version = "0.2.4"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0"
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -8214,7 +8375,7 @@ dependencies = [
"block",
"cfg_aliases 0.1.1",
"core-graphics-types",
"glow 0.14.1",
"glow",
"glutin_wgl_sys",
"gpu-alloc",
"gpu-allocator",
@ -8226,7 +8387,7 @@ dependencies = [
"log",
"metal 0.29.0",
"naga",
"ndk-sys",
"ndk-sys 0.5.0+25.2.9519653",
"objc",
"once_cell",
"parking_lot",
@ -8601,37 +8762,41 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winit"
version = "0.29.15"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca"
checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67"
dependencies = [
"ahash",
"android-activity",
"atomic-waker",
"bitflags 2.6.0",
"block2",
"bytemuck",
"calloop",
"cfg_aliases 0.1.1",
"cfg_aliases 0.2.1",
"concurrent-queue",
"core-foundation 0.9.4",
"core-graphics",
"cursor-icon",
"icrate",
"dpi",
"js-sys",
"libc",
"log",
"memmap2",
"ndk",
"ndk-sys",
"objc2",
"once_cell",
"objc2-app-kit",
"objc2-foundation",
"objc2-ui-kit",
"orbclient",
"percent-encoding",
"pin-project",
"raw-window-handle",
"redox_syscall 0.3.5",
"redox_syscall 0.4.1",
"rustix",
"sctk-adwaita",
"smithay-client-toolkit",
"smol_str",
"tracing",
"unicode-segmentation",
"wasm-bindgen",
"wasm-bindgen-futures",
@ -8641,7 +8806,7 @@ dependencies = [
"wayland-protocols-plasma",
"web-sys",
"web-time",
"windows-sys 0.48.0",
"windows-sys 0.52.0",
"x11-dl",
"x11rb",
"xkbcommon-dl",

View file

@ -33,9 +33,11 @@ allow = [
"BSL-1.0",
"CC0-1.0",
"ISC",
"LicenseRef-UFL-1.0", # No official SPDX, see https://github.com/emilk/egui/issues/2321.
"MIT",
"MPL-2.0",
"OpenSSL",
"OFL-1.1",
"Unicode-3.0",
"Zlib",
"zlib-acknowledgement",

View file

@ -102,13 +102,13 @@ webxr = { git = "https://github.com/servo/webxr" }
# For optional feature servo_allocator/use-system-allocator
servo_allocator = { path = "../../components/allocator" }
arboard = { version = "3" }
egui = { version = "0.28.1" }
egui_glow = { version = "0.28.1", features = ["winit"] }
egui-winit = { version = "0.28.1", default-features = false, features = ["clipboard", "wayland"] }
egui = { version = "0.29.1" }
egui_glow = { version = "0.29.1", features = ["winit"] }
egui-winit = { version = "0.29.1", default-features = false, features = ["clipboard", "wayland"] }
euclid = { workspace = true }
gilrs = "0.11.0"
gleam = { workspace = true }
glow = "0.13.1"
glow = "0.14.1"
headers = { workspace = true }
http = { workspace = true }
keyboard-types = { workspace = true }
@ -119,7 +119,7 @@ shellwords = "1.0.0"
surfman = { workspace = true, features = ["sm-x11", "sm-raw-window-handle-06"] }
tinyfiledialogs = "3.0"
webxr = { git = "https://github.com/servo/webxr", features = ["ipc", "glwindow", "headless"] }
winit = "0.29.10"
winit = "0.30.5"
[target.'cfg(any(all(target_os = "linux", not(target_env = "ohos")), target_os = "windows"))'.dependencies]
image = { workspace = true }

View file

@ -22,7 +22,7 @@ use webxr::glwindow::GlWindowDiscovery;
#[cfg(target_os = "windows")]
use webxr::openxr::{AppInfo, OpenXrDiscovery};
use winit::event::WindowEvent;
use winit::event_loop::EventLoopWindowTarget;
use winit::event_loop::ActiveEventLoop;
use winit::window::WindowId;
use super::events_loop::{EventsLoop, WakerEvent};
@ -80,7 +80,7 @@ impl App {
} else {
Rc::new(headed_window::Window::new(
opts::get().initial_window_size,
&events_loop,
&events_loop.as_winit(),
no_native_titlebar,
device_pixel_ratio_override,
))
@ -116,7 +116,12 @@ impl App {
debug_assert_eq!(webrender_gl.get_error(), gleam::gl::NO_ERROR);
app.minibrowser = Some(
Minibrowser::new(&rendering_context, &events_loop, initial_url.clone()).into(),
Minibrowser::new(
&rendering_context,
&events_loop.as_winit(),
initial_url.clone(),
)
.into(),
);
}
@ -164,10 +169,9 @@ impl App {
// ever try to make use of it once shutdown begins and
// it stops being valid.
let w = unsafe {
std::mem::transmute::<
&EventLoopWindowTarget<WakerEvent>,
&'static EventLoopWindowTarget<WakerEvent>,
>(w.unwrap())
std::mem::transmute::<&ActiveEventLoop, &'static ActiveEventLoop>(
w.unwrap(),
)
};
let factory = Box::new(move || Ok(window.new_glwindow(w)));
Some(XrDiscovery::GlWindow(GlWindowDiscovery::new(

View file

@ -51,12 +51,12 @@ pub struct EguiGlow {
impl EguiGlow {
/// For automatic shader version detection set `shader_version` to `None`.
pub fn new<E>(
event_loop: &winit::event_loop::EventLoopWindowTarget<E>,
pub fn new(
event_loop: &winit::event_loop::EventLoop<super::events_loop::WakerEvent>,
gl: std::sync::Arc<glow::Context>,
shader_version: Option<ShaderVersion>,
) -> Self {
let painter = egui_glow::Painter::new(gl, "", shader_version)
let painter = egui_glow::Painter::new(gl, "", shader_version, false)
.map_err(|err| {
log::error!("error occurred in initializing painter:\n{err}");
})
@ -70,6 +70,7 @@ impl EguiGlow {
event_loop,
None,
None,
None,
),
egui_ctx,
painter,

View file

@ -9,6 +9,9 @@ use std::time;
use log::warn;
use servo::embedder_traits::EventLoopWaker;
use winit::error::EventLoopError;
use winit::event::{Event, StartCause};
use winit::event_loop::{ActiveEventLoop, EventLoop as WinitEventLoop};
#[cfg(target_os = "macos")]
use winit::platform::macos::{ActivationPolicy, EventLoopBuilderExtMacOS};
@ -33,36 +36,25 @@ impl EventsLoop {
// Ideally, we could use the winit event loop in both modes,
// but on Linux, the event loop requires a X11 server.
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
pub fn new(
_headless: bool,
_has_output_file: bool,
) -> Result<EventsLoop, winit::error::EventLoopError> {
pub fn new(_headless: bool, _has_output_file: bool) -> Result<EventsLoop, EventLoopError> {
Ok(EventsLoop(EventLoop::Winit(Some(
winit::event_loop::EventLoopBuilder::with_user_event().build()?,
WinitEventLoop::with_user_event().build()?,
))))
}
#[cfg(target_os = "linux")]
pub fn new(
headless: bool,
_has_output_file: bool,
) -> Result<EventsLoop, winit::error::EventLoopError> {
pub fn new(headless: bool, _has_output_file: bool) -> Result<EventsLoop, EventLoopError> {
Ok(EventsLoop(if headless {
EventLoop::Headless(Arc::new((Mutex::new(false), Condvar::new())))
} else {
EventLoop::Winit(Some(
winit::event_loop::EventLoopBuilder::with_user_event().build()?,
))
EventLoop::Winit(Some(WinitEventLoop::with_user_event().build()?))
}))
}
#[cfg(target_os = "macos")]
pub fn new(
headless: bool,
_has_output_file: bool,
) -> Result<EventsLoop, winit::error::EventLoopError> {
pub fn new(headless: bool, _has_output_file: bool) -> Result<EventsLoop, EventLoopError> {
Ok(EventsLoop(if headless {
EventLoop::Headless(Arc::new((Mutex::new(false), Condvar::new())))
} else {
let mut event_loop_builder = winit::event_loop::EventLoopBuilder::with_user_event();
let mut event_loop_builder = WinitEventLoop::with_user_event();
if _has_output_file {
// Prevent the window from showing in Dock.app, stealing focus,
// when generating an output file.
@ -85,7 +77,7 @@ impl EventsLoop {
EventLoop::Headless(ref data) => Box::new(HeadlessEventLoopWaker(data.clone())),
}
}
pub fn as_winit(&self) -> &winit::event_loop::EventLoop<WakerEvent> {
pub fn as_winit(&self) -> &WinitEventLoop<WakerEvent> {
match self.0 {
EventLoop::Winit(Some(ref event_loop)) => event_loop,
EventLoop::Winit(None) | EventLoop::Headless(..) => {
@ -96,16 +88,12 @@ impl EventsLoop {
pub fn run_forever<F>(self, mut callback: F)
where
F: 'static
+ FnMut(
winit::event::Event<WakerEvent>,
Option<&winit::event_loop::EventLoopWindowTarget<WakerEvent>>,
&mut ControlFlow,
),
F: 'static + FnMut(Event<WakerEvent>, Option<&ActiveEventLoop>, &mut ControlFlow),
{
match self.0 {
EventLoop::Winit(events_loop) => {
let events_loop = events_loop.expect("Can't run an unavailable event loop.");
#[allow(deprecated)]
events_loop
.run(move |e, window_target| {
let mut control_flow = ControlFlow::default();
@ -116,12 +104,12 @@ impl EventsLoop {
},
EventLoop::Headless(ref data) => {
let (flag, condvar) = &**data;
let mut event = winit::event::Event::NewEvents(winit::event::StartCause::Init);
let mut event = Event::NewEvents(StartCause::Init);
loop {
self.sleep(flag, condvar);
let mut control_flow = ControlFlow::Poll;
callback(event, None, &mut control_flow);
event = winit::event::Event::<WakerEvent>::UserEvent(WakerEvent);
event = Event::<WakerEvent>::UserEvent(WakerEvent);
if control_flow != ControlFlow::Poll {
*flag.lock().unwrap() = false;
@ -164,7 +152,7 @@ pub enum ControlFlow {
}
impl ControlFlow {
fn apply_to(self, window_target: &winit::event_loop::EventLoopWindowTarget<WakerEvent>) {
fn apply_to(self, window_target: &ActiveEventLoop) {
match self {
ControlFlow::Poll => {
window_target.set_control_flow(winit::event_loop::ControlFlow::Poll)

View file

@ -30,7 +30,7 @@ use winit::keyboard::{Key as LogicalKey, ModifiersState, NamedKey};
#[cfg(any(target_os = "linux", target_os = "windows"))]
use winit::window::Icon;
use super::events_loop::{EventsLoop, WakerEvent};
use super::events_loop::WakerEvent;
use super::geometry::{winit_position_to_euclid_point, winit_size_to_euclid_size};
use super::keyutils::keyboard_event_from_winit;
use super::window_trait::{WindowPortsMethods, LINE_HEIGHT};
@ -60,7 +60,7 @@ pub struct Window {
impl Window {
pub fn new(
win_size: Size2D<u32, DeviceIndependentPixel>,
events_loop: &EventsLoop,
event_loop: &winit::event_loop::EventLoop<WakerEvent>,
no_native_titlebar: bool,
device_pixel_ratio_override: Option<f32>,
) -> Window {
@ -72,15 +72,16 @@ impl Window {
// #9996.
let visible = opts.output_file.is_none() && !no_native_titlebar;
let window_builder = winit::window::WindowBuilder::new()
let window_attr = winit::window::Window::default_attributes()
.with_title("Servo".to_string())
.with_decorations(!no_native_titlebar)
.with_transparent(no_native_titlebar)
.with_inner_size(LogicalSize::new(win_size.width, win_size.height))
.with_visible(visible);
let winit_window = window_builder
.build(events_loop.as_winit())
#[allow(deprecated)]
let winit_window = event_loop
.create_window(window_attr)
.expect("Failed to create window.");
#[cfg(any(target_os = "linux", target_os = "windows"))]
@ -89,8 +90,7 @@ impl Window {
winit_window.set_window_icon(Some(load_icon(icon_bytes)));
}
let primary_monitor = events_loop
.as_winit()
let primary_monitor = winit_window
.available_monitors()
.nth(0)
.expect("No monitor detected");
@ -377,7 +377,7 @@ impl WindowPortsMethods for Window {
return;
},
};
self.winit_window.set_cursor_icon(winit_cursor);
self.winit_window.set_cursor(winit_cursor);
self.winit_window.set_cursor_visible(true);
}
@ -460,7 +460,7 @@ impl WindowPortsMethods for Window {
.borrow_mut()
.push(EmbedderEvent::Touch(phase, id, point));
},
winit::event::WindowEvent::TouchpadMagnify { delta, .. } => {
winit::event::WindowEvent::PinchGesture { delta, .. } => {
let magnification = delta as f32 + 1.0;
self.event_queue
.borrow_mut()
@ -489,17 +489,17 @@ impl WindowPortsMethods for Window {
fn new_glwindow(
&self,
event_loop: &winit::event_loop::EventLoopWindowTarget<WakerEvent>,
event_loop: &winit::event_loop::ActiveEventLoop,
) -> Box<dyn webxr::glwindow::GlWindow> {
let size = self.winit_window.outer_size();
let window_builder = winit::window::WindowBuilder::new()
let window_attr = winit::window::Window::default_attributes()
.with_title("Servo XR".to_string())
.with_inner_size(size)
.with_visible(true);
let winit_window = window_builder
.build(event_loop)
let winit_window = event_loop
.create_window(window_attr)
.expect("Failed to create window.");
let pose = Rc::new(XRWindowPose {
@ -531,15 +531,15 @@ impl WindowMethods for Window {
let viewport_origin = DeviceIntPoint::zero(); // bottom left
let viewport_size = winit_size_to_euclid_size(self.winit_window.inner_size()).to_f32();
let viewport = DeviceIntRect::from_origin_and_size(viewport_origin, viewport_size.to_i32());
let screen = self.screen_size.to_i32();
let screen_size = self.screen_size.to_i32();
EmbedderCoordinates {
viewport,
framebuffer: viewport.size(),
window_rect: DeviceIntRect::from_origin_and_size(window_origin, window_size),
screen_size: screen,
screen_size,
// FIXME: Winit doesn't have API for available size. Fallback to screen size
available_screen_size: screen,
available_screen_size: screen_size,
hidpi_factor: self.hidpi_factor(),
}
}

View file

@ -20,7 +20,6 @@ use servo::webrender_api::units::{DeviceIntRect, DeviceIntSize};
use servo::webrender_traits::RenderingContext;
use surfman::{Connection, Context, Device, SurfaceType};
use super::events_loop::WakerEvent;
use crate::desktop::window_trait::WindowPortsMethods;
pub struct Window {
@ -70,7 +69,7 @@ impl WindowPortsMethods for Window {
}
fn id(&self) -> winit::window::WindowId {
unsafe { winit::window::WindowId::dummy() }
winit::window::WindowId::dummy()
}
fn request_inner_size(&self, size: DeviceIntSize) -> Option<DeviceIntSize> {
@ -136,7 +135,7 @@ impl WindowPortsMethods for Window {
fn new_glwindow(
&self,
_events_loop: &winit::event_loop::EventLoopWindowTarget<WakerEvent>,
_events_loop: &winit::event_loop::ActiveEventLoop,
) -> Box<dyn webxr::glwindow::GlWindow> {
unimplemented!()
}

View file

@ -27,10 +27,12 @@ use servo::servo_url::ServoUrl;
use servo::style_traits::DevicePixel;
use servo::webrender_traits::RenderingContext;
use servo::TopLevelBrowsingContextId;
use winit::event::{ElementState, MouseButton};
use winit::event::{ElementState, MouseButton, WindowEvent};
use winit::event_loop::EventLoop;
use winit::window::Window;
use super::egui_glue::EguiGlow;
use super::events_loop::EventsLoop;
use super::events_loop::WakerEvent;
use super::geometry::winit_position_to_euclid_point;
use super::webview::{LoadStatus, WebViewManager};
use super::window_trait::WindowPortsMethods;
@ -78,7 +80,7 @@ fn truncate_with_ellipsis(input: &str, max_length: usize) -> String {
impl Minibrowser {
pub fn new(
rendering_context: &RenderingContext,
events_loop: &EventsLoop,
event_loop: &EventLoop<WakerEvent>,
initial_url: ServoUrl,
) -> Self {
let gl = unsafe {
@ -87,7 +89,7 @@ impl Minibrowser {
// Adapted from https://github.com/emilk/egui/blob/9478e50d012c5138551c38cbee16b07bc1fcf283/crates/egui_glow/examples/pure_glow.rs
#[allow(clippy::arc_with_non_send_sync)]
let context = EguiGlow::new(events_loop.as_winit(), Arc::new(gl), None);
let context = EguiGlow::new(event_loop, Arc::new(gl), None);
// Disable the builtin egui handlers for the Ctrl+Plus, Ctrl+Minus and Ctrl+0
// shortcuts as they don't work well with servoshell's `device-pixel-ratio` CLI argument.
@ -118,14 +120,10 @@ impl Minibrowser {
/// Preprocess the given [winit::event::WindowEvent], returning unconsumed for mouse events in
/// the Servo browser rect. This is needed because the CentralPanel we create for our webview
/// would otherwise make egui report events in that area as consumed.
pub fn on_window_event(
&mut self,
window: &winit::window::Window,
event: &winit::event::WindowEvent,
) -> EventResponse {
pub fn on_window_event(&mut self, window: &Window, event: &WindowEvent) -> EventResponse {
let mut result = self.context.on_window_event(window, event);
result.consumed &= match event {
winit::event::WindowEvent::CursorMoved { position, .. } => {
WindowEvent::CursorMoved { position, .. } => {
let scale = Scale::<_, DeviceIndependentPixel, _>::new(
self.context.egui_ctx.pixels_per_point(),
);
@ -134,7 +132,7 @@ impl Minibrowser {
self.last_mouse_position
.map_or(false, |p| self.is_in_browser_rect(p))
},
winit::event::WindowEvent::MouseInput {
WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Forward,
..
@ -144,7 +142,7 @@ impl Minibrowser {
.push(MinibrowserEvent::Forward);
true
},
winit::event::WindowEvent::MouseInput {
WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Back,
..
@ -152,8 +150,7 @@ impl Minibrowser {
self.event_queue.borrow_mut().push(MinibrowserEvent::Back);
true
},
winit::event::WindowEvent::MouseWheel { .. } |
winit::event::WindowEvent::MouseInput { .. } => self
WindowEvent::MouseWheel { .. } | WindowEvent::MouseInput { .. } => self
.last_mouse_position
.map_or(false, |p| self.is_in_browser_rect(p)),
_ => true,
@ -259,7 +256,7 @@ impl Minibrowser {
/// CentralPanel when [`Minibrowser::paint`] is called.
pub fn update(
&mut self,
window: &winit::window::Window,
window: &Window,
webviews: &mut WebViewManager<dyn WindowPortsMethods>,
servo_framebuffer_id: Option<gl::GLuint>,
reason: &'static str,
@ -484,7 +481,7 @@ impl Minibrowser {
}
/// Paint the minibrowser, as of the last update.
pub fn paint(&mut self, window: &winit::window::Window) {
pub fn paint(&mut self, window: &Window) {
unsafe {
use glow::HasContext as _;
self.context

View file

@ -114,9 +114,10 @@ mod from_winit {
Self::CursorLeft { .. } => target_variant!("CursorLeft"),
Self::MouseWheel { .. } => target_variant!("MouseWheel"),
Self::MouseInput { .. } => target_variant!("MouseInput"),
Self::TouchpadMagnify { .. } => target_variant!("TouchpadMagnify"),
Self::SmartMagnify { .. } => target_variant!("SmartMagnify"),
Self::TouchpadRotate { .. } => target_variant!("TouchpadRotate"),
Self::PanGesture { .. } => target_variant!("PanGesture"),
Self::PinchGesture { .. } => target_variant!("PinchGesture"),
Self::DoubleTapGesture { .. } => target_variant!("DoubleTapGesture"),
Self::RotationGesture { .. } => target_variant!("RotationGesture"),
Self::TouchpadPressure { .. } => target_variant!("TouchpadPressure"),
Self::AxisMotion { .. } => target_variant!("AxisMotion"),
Self::Touch(..) => target_variant!("Touch"),

View file

@ -13,8 +13,6 @@ use servo::servo_geometry::DeviceIndependentPixel;
use servo::style_traits::DevicePixel;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize};
use super::events_loop::WakerEvent;
// This should vary by zoom level and maybe actual text size (focused or under cursor)
pub const LINE_HEIGHT: f32 = 38.0;
@ -43,7 +41,7 @@ pub trait WindowPortsMethods: WindowMethods {
fn set_cursor(&self, _cursor: Cursor) {}
fn new_glwindow(
&self,
events_loop: &winit::event_loop::EventLoopWindowTarget<WakerEvent>,
event_loop: &winit::event_loop::ActiveEventLoop,
) -> Box<dyn webxr::glwindow::GlWindow>;
fn winit_window(&self) -> Option<&winit::window::Window>;
fn toolbar_height(&self) -> Length<f32, DeviceIndependentPixel>;

View file

@ -52,9 +52,11 @@ packages = [
"foreign-types",
"foreign-types-shared",
"metal",
"glow",
"windows-core",
# wgpu-hal depends on 0.5.0.
"ndk-sys",
# quickcheck (required by layout_2020 for tests) is
# stuck on 0.8.4 with no new releases.
"env_logger",