zed/crates
张小白 6af385c09e
windows: Fix some weird IME window panic (#15286)
Previously, we used messages greater than `WM_USER` to pass information
between `WindowsPlatform` and `WindowsWindow`. For example, to close a
window, we handled it as follows:
1. The window sends a message with `WM_USER + 2` to `WindowsPlatform`.
2. `WindowsPlatform`, upon receiving this message, casts the `lparam` to
`HWND` and closes the window.

According to Microsoft's documentation, it is safe to use values between
`WM_USER` and `0xBFFF` as messages. However, certain versions of
Microsoft's IME use `WM_USER + 2` for UNKNOWN purposes. This causes step
2 to be erroneously triggered. The IME window's `lparam` value could be
arbitrary, leading to an attempt to close an arbitrary `HWND` and
resulting in errors.

It is quite surprising that Microsoft indicates using `WM_USER + 2` is
safe, yet Microsoft itself breaks this convention. I mean, well done
Microsoft!

This PR addresses the issue by using the `wparam` with a specific random
value for validation purpose when sending the aforementioned message.
Before `WindowsPlatform` attempts to close the window, it will first
verify the `wparam` value.

Special thanks to @shenjackyuanjie for helping me on this.


Co-authored-by: shenjackyuanjie <3695888@qq.com>


Release Notes:

- Fixed weird panic when IME window is closing(#15185, #12563).

---------

Co-authored-by: shenjack <3695888@qq.com>
2024-07-26 17:40:55 -07:00
..
activity_indicator Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
anthropic Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
assets Move from Zed fonts to IBM Plex (#13596) 2024-06-27 14:36:44 -06:00
assistant Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
assistant_slash_command Lay the groundwork for collaborating on assistant panel (#13991) 2024-07-10 17:36:22 +02:00
assistant_tooling Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
audio Make tests less noisy (#12463) 2024-05-29 18:06:45 -07:00
auto_update Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
breadcrumbs breadcrumbs: Use early return in set_active_pane_item (#14691) 2024-07-17 18:58:44 -04:00
call chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
channel Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
cli Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
client Add repl events (#15259) 2024-07-26 03:31:41 -04:00
clock Lay the groundwork for collaborating on assistant panel (#13991) 2024-07-10 17:36:22 +02:00
collab Upgrade dashmap to v6 (#15305) 2024-07-26 17:58:37 -04:00
collab_ui Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
collections gpui: Add SVG rendering to img element and generic asset cache (#9931) 2024-03-29 17:09:49 -07:00
command_palette Add command aliases (#14826) 2024-07-19 12:48:48 -06:00
command_palette_hooks Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
completion Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
copilot chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
db paths: Replace lazy_static! with OnceLock (#13213) 2024-06-18 12:22:37 -04:00
dev_server_projects remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
diagnostics Prefer .map for conditionals with else conditions (#15118) 2024-07-24 17:09:07 -04:00
editor Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
extension chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
extension_api zed_extension_api: Return structured slash command completions (#13879) 2024-07-05 14:08:42 -04:00
extension_cli Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
extensions_ui Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
feature_flags feature_flags: Add support for flags that aren't auto-enabled for staff (#15093) 2024-07-24 11:23:50 -04:00
feedback Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
file_finder chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
file_icons Make tests less noisy (#12463) 2024-05-29 18:06:45 -07:00
fs zed: Mark restored buffers as conflicted if file changed on disk between store & restore (#15207) 2024-07-25 18:04:47 +02:00
fsevent Retain run loop (#11241) 2024-04-30 23:31:59 -06:00
fuzzy chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
git Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
git_hosting_providers Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
go_to_line Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
google_ai Add missing workspace lints (#15237) 2024-07-25 19:52:24 -04:00
gpui windows: Fix some weird IME window panic (#15286) 2024-07-26 17:40:55 -07:00
gpui_macros Use US English spelling of "behavior" and "customize" (#15117) 2024-07-24 16:36:01 -04:00
headless remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
html_to_markdown Publish html_to_markdown (#13718) 2024-07-01 17:18:58 -04:00
http_client Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
image_viewer Add text_color helper for tab contents (#14737) 2024-07-18 09:27:05 -04:00
indexed_docs Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
inline_completion_button assistant: Overhaul provider infrastructure (#14929) 2024-07-23 19:48:41 +02:00
install_cli Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
journal Add the ability for extensions to provide language settings (#10296) 2024-04-08 19:17:12 -04:00
language Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
language_model Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
language_selector Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
language_tools Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
languages rust: Add static items to the outline (#15225) 2024-07-26 00:52:42 +02:00
live_kit_client chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
live_kit_server live_kit_server: Replace jwt with jsonwebtoken (#15302) 2024-07-26 17:20:01 -04:00
lsp chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
markdown chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
markdown_preview Add Markdown Preview Toggle (#15215) 2024-07-26 11:08:42 -04:00
media linux: Better GPU debugging (#14706) 2024-07-23 09:56:45 -06:00
menu open picker (#14524) 2024-07-15 17:04:15 -06:00
multi_buffer chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
node_runtime Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
notifications Remove never-used client parameter from message handler functions (#13406) 2024-06-22 16:07:36 -07:00
ollama assistant: Fix issues when configuring different providers (#15072) 2024-07-24 11:21:31 +02:00
open_ai Add missing workspace lints (#15237) 2024-07-25 19:52:24 -04:00
outline Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
outline_panel Use US English spelling of "behavior" and "customize" (#15117) 2024-07-24 16:36:01 -04:00
paths Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
picker vim remap 2 (#15193) 2024-07-25 09:00:53 -06:00
prettier Lookup prettier more leniently (#14403) 2024-07-13 21:59:14 +03:00
project tasks: Use environment variables from project (#15266) 2024-07-26 18:19:53 +02:00
project_panel Auto fold directories in the project panel by default (#15273) 2024-07-26 15:26:20 +03:00
project_symbols Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
proto tasks: Use environment variables from project (#15266) 2024-07-26 18:19:53 +02:00
quick_action_bar ui: Add functions for generating textual representations of key bindings (#15287) 2024-07-26 12:52:59 -04:00
recent_projects SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
refineable Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
release_channel auto-updates: Do not poll for updates on dev channel (#13311) 2024-06-20 15:00:54 +02:00
remote SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
remote_server SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
repl Upgrade base64 to v0.22 (#15304) 2024-07-26 17:40:38 -04:00
rich_text chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
rope Revert "Avoid buffering line content to compute indent guides" (#15282) 2024-07-26 11:05:24 -04:00
rpc Upgrade base64 to v0.22 (#15304) 2024-07-26 17:40:38 -04:00
search Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
semantic_index chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
semantic_version Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
session zed: Add ability to restore last session w/ multiple windows (#14965) 2024-07-23 19:44:02 +02:00
settings Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
settings_ui settings_ui: Add font ligature settings controls (#15301) 2024-07-26 17:06:14 -04:00
snippet Correct escaping in snippets (#14912) 2024-07-22 00:57:34 +02:00
snippet_provider extensions: Add support for snippets provided by extensions (#14020) 2024-07-10 09:40:50 +02:00
sqlez Remove extraneous Cargo.lock files (#14001) 2024-07-09 12:15:34 -04:00
sqlez_macros Dynamicer builds (#13074) 2024-06-21 16:32:32 -07:00
story Introduce a new markdown crate (#11556) 2024-05-09 11:03:33 +02:00
storybook Hoist strum to workspace level (#15243) 2024-07-25 21:30:48 -04:00
sum_tree Revert "Avoid buffering line content to compute indent guides" (#15282) 2024-07-26 11:05:24 -04:00
supermaven Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
supermaven_api Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
tab_switcher Add missing workspace lints (#15237) 2024-07-25 19:52:24 -04:00
task tasks: Use environment variables from project (#15266) 2024-07-26 18:19:53 +02:00
tasks_ui tasks: Use environment variables from project (#15266) 2024-07-26 18:19:53 +02:00
telemetry_events Add repl events (#15259) 2024-07-26 03:31:41 -04:00
terminal Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
terminal_view Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
text Revert "Avoid buffering line content to compute indent guides" (#15282) 2024-07-26 11:05:24 -04:00
theme Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
theme_importer Hoist strum to workspace level (#15243) 2024-07-25 21:30:48 -04:00
theme_selector settings_ui: Add theme settings controls (#15115) 2024-07-24 16:25:52 -04:00
time_format Inline git blame (#10398) 2024-04-15 14:21:52 +02:00
title_bar Bump tree-sitter and related core language parser libraries (#14986) 2024-07-24 23:38:21 +03:00
ui ui: Add functions for generating textual representations of key bindings (#15287) 2024-07-26 12:52:59 -04:00
ui_input Rename ui_text_field crate to ui_input (#13949) 2024-07-08 17:05:30 -04:00
util SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
vcs_menu Adjust list item & pickers spacing (#14250) 2024-07-15 10:23:18 -03:00
vim SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
welcome assistant: Overhaul provider infrastructure (#14929) 2024-07-23 19:48:41 +02:00
workspace SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
worktree chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
zed SSH remote ui (#15129) 2024-07-26 16:45:44 -06:00
zed_actions Add more menus to Zed (#12940) 2024-06-18 12:16:54 -07:00