windows: Remove the use of DispatcherQueue and fix FileSaveDialog unresponsive issue (#17946)

Closes #17069, closes #12410


With the help of @kennykerr (Creator of C++/WinRT and the crate
`windows-rs`, Engineer on the Windows team at Microsoft) and @riverar
(Windows Development expert), we discovered that this bug only occurs
when an IME with a candidate window, such as Microsoft Pinyin IME, is
active. In this case, the `FileSaveDialog` becomes unresponsive—while
the dialog itself appears to be functioning, it doesn't accept any mouse
or keyboard input.

After a period of debugging and testing, I found that this issue only
arises when using `DispatcherQueue` to dispatch runnables on the UI
thread. After @kennykerr’s further investigation, Kenny identified that
this is a bug with `DispatcherQueue`, and he recommended to avoid using
`DispatcherQueue`. Given the uncertainty about whether Microsoft will
address this bug in the foreseeable future, I have removed the use of
`DispatcherQueue`.

Co-authored-by: Kenny <kenny@kennykerr.ca>

Release Notes:

- N/A

---------

Co-authored-by: Kenny <kenny@kennykerr.ca>
This commit is contained in:
Junkui Zhang 2024-09-18 06:45:08 +08:00 committed by GitHub
parent 56f9e4c7b3
commit fbb402ef12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 104 additions and 71 deletions

View file

@ -50,7 +50,7 @@ parking = "2.0.0"
parking_lot.workspace = true
postage.workspace = true
profiling.workspace = true
rand = { optional = true, workspace = true}
rand = { optional = true, workspace = true }
raw-window-handle = "0.6"
refineable.workspace = true
resvg = { version = "0.41.0", default-features = false }
@ -110,6 +110,7 @@ blade-graphics.workspace = true
blade-macros.workspace = true
blade-util.workspace = true
bytemuck = "1"
flume = "0.11"
[target.'cfg(target_os = "linux")'.dependencies]
as-raw-xcb-connection = "1"
@ -117,7 +118,6 @@ ashpd.workspace = true
calloop = "0.13.0"
calloop-wayland-source = "0.3.0"
cosmic-text = { git = "https://github.com/pop-os/cosmic-text", rev = "542b20c" }
flume = "0.11"
wayland-backend = { version = "0.3.3", features = ["client_system", "dlopen"] }
wayland-client = { version = "0.31.2" }
wayland-cursor = "0.31.1"