zed/crates
tims 71a0eb3b13
windows: Fix cursor style not changing when hovering over items in the title bar (#22580)
Closes #22578

Currently, the `hovered` boolean in the window state is only updated by
the `WM_MOUSELEAVE` event, which fires when the mouse cursor leaves the
window's working area. This means that when the user moves the cursor
from the window to the title bar, `hovered` is set to `false`. Later in
the code, this flag is used to determine the cursor style and check if
the cursor is over the correct window.

The `hovered` boolean should remain active even when the mouse is over
non-client items, such as the title bar or window borders. This PR fixes
that by using `WM_NCMOUSELEAVE` event, which is triggered when the mouse
leaves non-client items. This event is used to update the `hovered`
boolean accordingly.

Now, `hovered` is `true` when the mouse is over the window's working
area, as well as non-client areas like the title bar.

More context:

- Existing: `dwFlags: TME_LEAVE` tracks window area mouse leaves, which
is used in `handle_mouse_move_msg` func.
- New: `dwFlags: TME_LEAVE | TME_NONCLIENT` tracks non-client mouse
leaves, which is used in `handle_nc_mouse_move_msg` func.

Preview:


https://github.com/user-attachments/assets/b319303f-81b9-45cb-bf0c-535a59b96561

Release Notes:

- Fix cursor style not changing on hover over items in the title bar on
Windows
2025-01-04 00:01:29 +00:00
..
activity_indicator Add Corner to geometry and make names of corner methods consistent (#22119) 2024-12-16 22:57:15 -07:00
anthropic anthropic: Allow specifying additional beta headers for custom models (#20551) 2025-01-03 23:46:32 +00:00
assets
assistant assistant: Remove unused AssistantSettings::update_file (#22636) 2025-01-03 23:34:15 +00:00
assistant2 Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
assistant_slash_command
assistant_tool
assistant_tools
audio
auto_update
auto_update_ui Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
breadcrumbs chore: Remove outline dependency from breadcrumbs (#22504) 2024-12-30 12:08:26 +00:00
call More telemetry events (#22171) 2024-12-17 22:16:59 -07:00
channel
cli Revert "Have Zed cli output logs path to stderr" (#22540) 2025-01-01 16:21:08 +00:00
client chore: Remove explicit usages of once_cell in favor of std (#22407) 2024-12-25 00:33:26 +00:00
clock
collab Improve Linux panic reporting (#22202) 2024-12-22 08:20:17 +00:00
collab_ui collab_ui: Show the chat panel icon when the chat panel is active (#22593) 2025-01-02 22:53:34 +00:00
collections
command_palette Match keymap-style action names in command palette (#22149) 2024-12-19 12:48:54 +00:00
command_palette_hooks Use the same InlineAssist action between both assistant and assistant2 (#22126) 2024-12-16 23:57:07 -05:00
context_server Dequalify WindowContext and AsyncWindowContext identifiers (#22444) 2024-12-28 21:21:32 +00:00
context_server_settings
copilot copilot: Update Copilot Chat to o1 GA model version (#22376) 2024-12-27 18:09:50 +00:00
db
diagnostics Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
docs_preprocessor
editor Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
evals
extension
extension_api
extension_cli
extension_host Add telemetry::event! (#22146) 2024-12-17 11:39:18 -07:00
extensions_ui Cleanups preparing for WindowContext refactor (#22475) 2024-12-28 21:36:14 +00:00
feature_flags
feedback Dequalify WindowContext and AsyncWindowContext identifiers (#22444) 2024-12-28 21:21:32 +00:00
file_finder Cleanups preparing for WindowContext refactor (#22475) 2024-12-28 21:36:14 +00:00
file_icons Add a CI check for todo! and FIXME comments (#21950) 2024-12-20 08:38:50 +00:00
fs linux: Fix saving file with root ownership (#22045) 2024-12-19 22:16:01 +00:00
fsevent
fuzzy Fuzzy match performance improvements redo (#22561) 2025-01-02 05:31:06 +00:00
git Rename GitRepository.path() to GitRepository.dot_git_dir() (#22026) 2024-12-14 15:30:56 -07:00
git_hosting_providers Use static LazyLocks for all constant regexes (#22225) 2024-12-19 02:20:35 +00:00
git_ui Decide which panel should be active for a dock based on ordering panels (#22346) 2024-12-30 14:43:17 +00:00
go_to_line Only debounce the cursor position in multibuffer excerpts (#21946) 2024-12-12 18:27:06 -08:00
google_ai
gpui windows: Fix cursor style not changing when hovering over items in the title bar (#22580) 2025-01-04 00:01:29 +00:00
gpui_macros Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
html_to_markdown Use static LazyLocks for all constant regexes (#22225) 2024-12-19 02:20:35 +00:00
http_client
image_viewer
indexed_docs Improve StringMatchCandidate::new interface (#22011) 2024-12-14 13:35:36 -07:00
inline_completion Show inline completions in menu only for supported providers (#22181) 2024-12-18 12:55:09 +01:00
inline_completion_button Add Corner to geometry and make names of corner methods consistent (#22119) 2024-12-16 22:57:15 -07:00
install_cli
journal
language Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
language_extension
language_model Add support for Claude 3.5 Haiku model (#22323) 2025-01-03 18:49:29 +00:00
language_model_selector language_model_selector: Refresh the models when the providers change (#22624) 2025-01-03 19:38:08 +00:00
language_models anthropic: Allow specifying additional beta headers for custom models (#20551) 2025-01-03 23:46:32 +00:00
language_selector Improve StringMatchCandidate::new interface (#22011) 2024-12-14 13:35:36 -07:00
language_tools Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
languages python: Adjust binary path based on OS (#22587) 2025-01-03 22:56:31 +00:00
livekit_client
livekit_client_macos
livekit_server
lsp Ensure zls is used for Zig as a primary language server (#22511) 2024-12-30 23:34:25 +00:00
markdown markdown: Make push_div work with Stateful<Div>s (#22622) 2025-01-03 18:24:04 +00:00
markdown_preview Add tooltip for Markdown Preview copy code button (#22057) 2024-12-17 14:46:38 -05:00
media Switch to a single GPU context in Blade (#20853) 2024-12-18 14:47:09 -07:00
menu Show restart transformation button after successful inline assist (#20439) 2024-12-13 20:31:54 -08:00
multi_buffer Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
node_runtime
notifications
ollama
open_ai
outline chore: Remove outline dependency from breadcrumbs (#22504) 2024-12-30 12:08:26 +00:00
outline_panel Decide which panel should be active for a dock based on ordering panels (#22346) 2024-12-30 14:43:17 +00:00
paths
picker Cleanups preparing for WindowContext refactor (#22475) 2024-12-28 21:36:14 +00:00
prettier Add .prettierignore support (#21297) 2024-12-12 15:45:44 -08:00
project Deduplicate edits from WorkspaceEdit LSP responses (#22512) 2024-12-31 00:50:57 +00:00
project_panel project_panel: Open rename file editor if pasted file was disambiguated (#19975) 2025-01-02 21:33:51 +00:00
project_symbols Add and use CodeLabel::filter_text() (#22054) 2024-12-15 22:24:41 -07:00
proto Resolve completion items once exactly (#22448) 2024-12-27 16:43:01 +00:00
recent_projects Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
refineable
release_channel chore: Remove explicit usages of once_cell in favor of std (#22407) 2024-12-25 00:33:26 +00:00
remote
remote_server Improve Linux panic reporting (#22202) 2024-12-22 08:20:17 +00:00
repl Dequalify WindowContext and AsyncWindowContext identifiers (#22444) 2024-12-28 21:21:32 +00:00
reqwest_client
rich_text
rope
rpc Upgrade strum to v0.26 (#22633) 2025-01-03 22:23:06 +00:00
search Improve project search design details (#22529) 2025-01-01 00:09:36 +00:00
semantic_index Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
semantic_version
session
settings
settings_ui Toggle & Switch (#21979) 2024-12-13 14:23:02 -05:00
snippet
snippet_provider
snippets_ui Improve StringMatchCandidate::new interface (#22011) 2024-12-14 13:35:36 -07:00
sqlez
sqlez_macros
story
storybook Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
sum_tree
supermaven Show inline completions in menu only for supported providers (#22181) 2024-12-18 12:55:09 +01:00
supermaven_api
tab_switcher Cleanups preparing for WindowContext refactor (#22475) 2024-12-28 21:36:14 +00:00
task Improve truncate efficiency and fix OBOE in truncate_and_remove_front (#22591) 2025-01-02 22:35:36 +00:00
tasks_ui Improve truncate efficiency and fix OBOE in truncate_and_remove_front (#22591) 2025-01-02 22:35:36 +00:00
telemetry Allow telemetry::event! with no properties (#22190) 2024-12-18 09:41:47 -07:00
telemetry_events Improve Linux panic reporting (#22202) 2024-12-22 08:20:17 +00:00
terminal terminal: Support clicking on "file://" URLs with line numbers (#22559) 2025-01-02 17:24:55 +00:00
terminal_view Decide which panel should be active for a dock based on ordering panels (#22346) 2024-12-30 14:43:17 +00:00
text Support diagnostic navigation in multibuffers (#22620) 2025-01-03 18:07:56 +00:00
theme deps: Bump indexmap to 2.0 (#22567) 2025-01-02 12:07:46 +00:00
theme_extension
theme_importer deps: Bump indexmap to 2.0 (#22567) 2025-01-02 12:07:46 +00:00
theme_selector More telemetry events (#22171) 2024-12-17 22:16:59 -07:00
time_format
title_bar linux: Add keyboard shortcuts for menus (#22074) 2025-01-03 18:19:24 +00:00
toolchain_selector Improve StringMatchCandidate::new interface (#22011) 2024-12-14 13:35:36 -07:00
ui Improve multibuffer excerpt affordances (#22167) 2024-12-30 12:23:11 +00:00
ui_input Remove usage of use gpui::* (#22310) 2024-12-20 22:52:11 +00:00
ui_macros
util Improve truncate efficiency and fix OBOE in truncate_and_remove_front (#22591) 2025-01-02 22:35:36 +00:00
vcs_menu Improve StringMatchCandidate::new interface (#22011) 2024-12-14 13:35:36 -07:00
vim Dequalify WindowContext and AsyncWindowContext identifiers (#22444) 2024-12-28 21:21:32 +00:00
vim_mode_setting
welcome Dequalify WindowContext and ViewContext references (#22477) 2024-12-28 23:09:55 +00:00
workspace pane: Turn off preview mode when pinning a tab (#22501) 2025-01-02 04:09:35 +00:00
worktree Fix permalink-to-line when Git repo root and worktree dir don't coincide (#22003) 2024-12-19 19:23:50 +00:00
zed Bump Zed to v0.169 (#22547) 2025-01-01 12:31:37 -05:00
zed_actions chore: Remove outline dependency from breadcrumbs (#22504) 2024-12-30 12:08:26 +00:00
zeta Allow disabling editor scrollbars programmatically (#22333) 2024-12-21 16:58:26 +00:00