fix(ui): prevent light flash on dark startup (#5637)

* fix(ui): prevent light flash on dark startup

* fix(window): apply initial dark/light theme to prevent white flash

* refactor(boot): optimize config fetch and theme fallback

* fix: system theme detection

* fix(window): remove black flash before loader by aligning initial paint with theme
This commit is contained in:
Sline
2025-11-28 15:15:17 +08:00
committed by GitHub
parent 34aa26813f
commit 683667f8ae
8 changed files with 500 additions and 44 deletions
Generated
+139 -3
View File
@@ -170,6 +170,24 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "ashpd"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3d60bee1a1d38c2077030f4788e1b4e31058d2e79a8cfc8f2b440bd44db290"
dependencies = [
"async-fs 2.2.0",
"async-net 2.0.0",
"enumflags2",
"futures-channel",
"futures-util",
"rand 0.8.5",
"serde",
"serde_repr",
"url",
"zbus",
]
[[package]]
name = "ashpd"
version = "0.11.0"
@@ -252,6 +270,32 @@ dependencies = [
"futures-lite 1.13.0",
]
[[package]]
name = "async-fs"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
dependencies = [
"async-lock 3.4.1",
"blocking",
"futures-lite 2.6.1",
]
[[package]]
name = "async-global-executor"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
dependencies = [
"async-channel 2.5.0",
"async-executor",
"async-io 2.6.0",
"async-lock 3.4.1",
"blocking",
"futures-lite 2.6.1",
"once_cell",
]
[[package]]
name = "async-io"
version = "1.13.0"
@@ -321,6 +365,17 @@ dependencies = [
"futures-lite 1.13.0",
]
[[package]]
name = "async-net"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
dependencies = [
"async-io 2.6.0",
"blocking",
"futures-lite 2.6.1",
]
[[package]]
name = "async-process"
version = "1.8.1"
@@ -385,6 +440,32 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "async-std"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b"
dependencies = [
"async-channel 1.9.0",
"async-global-executor",
"async-io 2.6.0",
"async-lock 3.4.1",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
"futures-lite 2.6.1",
"gloo-timers",
"kv-log-macro",
"log",
"memchr",
"once_cell",
"pin-project-lite",
"pin-utils",
"slab",
"wasm-bindgen-futures",
]
[[package]]
name = "async-stream"
version = "0.3.6"
@@ -1124,6 +1205,7 @@ dependencies = [
"compact_str",
"console-subscriber",
"criterion",
"dark-light",
"deelevate",
"delay_timer",
"dunce",
@@ -1705,6 +1787,20 @@ dependencies = [
"cipher",
]
[[package]]
name = "dark-light"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18e1a09f280e29a8b00bc7e81eca5ac87dca0575639c9422a5fa25a07bb884b8"
dependencies = [
"ashpd 0.10.3",
"async-std",
"objc2 0.5.2",
"objc2-foundation 0.2.2",
"web-sys",
"winreg 0.52.0",
]
[[package]]
name = "darling"
version = "0.21.3"
@@ -2977,6 +3073,18 @@ dependencies = [
"walkdir",
]
[[package]]
name = "gloo-timers"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
dependencies = [
"futures-channel",
"futures-core",
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "gobject-sys"
version = "0.18.0"
@@ -3969,6 +4077,15 @@ dependencies = [
"selectors",
]
[[package]]
name = "kv-log-macro"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
dependencies = [
"log",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@@ -4107,6 +4224,9 @@ name = "log"
version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
dependencies = [
"value-bag",
]
[[package]]
name = "loom"
@@ -6227,7 +6347,7 @@ version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed"
dependencies = [
"ashpd",
"ashpd 0.11.0",
"block2 0.6.2",
"dispatch2",
"glib-sys",
@@ -7049,10 +7169,10 @@ checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1"
dependencies = [
"async-channel 1.9.0",
"async-executor",
"async-fs",
"async-fs 1.6.0",
"async-io 1.13.0",
"async-lock 2.8.0",
"async-net",
"async-net 1.8.0",
"async-process 1.8.1",
"blocking",
"futures-lite 1.13.0",
@@ -8940,6 +9060,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "value-bag"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0"
[[package]]
name = "vcpkg"
version = "0.2.15"
@@ -9939,6 +10065,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "winreg"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
dependencies = [
"cfg-if",
"windows-sys 0.48.0",
]
[[package]]
name = "winreg"
version = "0.55.0"