From 7065da2b984e7aaa3e5e6e04bdb2c5168985ed66 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Fri, 26 Apr 2024 01:01:24 +0800 Subject: [PATCH] Fix project-panel double click file support on Windows (#10917) Release Notes: - Fixed project panel double click to force open file on Windows. Ref issue: #10898 @bennetbo I saw you was also used `event.down.click_count` in Markdown Preview. https://github.com/zed-industries/zed/commit/7dccbd8e3b61c48ae174807a4023332b7c1df06a#diff-c8d1735cb347ea08d03198df112343ec50a74de8d50414a6f3be6c6d674c6d19R161 And this also used in other place: image ## Test demo after updated Looks like it is no side effect ![2024-04-24 10 17 45](https://github.com/zed-industries/zed/assets/5518/0df4cf06-7448-4014-9df2-f2608a5f5314) --- crates/gpui/src/platform/windows/window.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/windows/window.rs b/crates/gpui/src/platform/windows/window.rs index 301dab271fc2da1c1681ff24b6149de5bee30367..f4cf1ded4409b6501657d6c6615e5603a5941d9a 100644 --- a/crates/gpui/src/platform/windows/window.rs +++ b/crates/gpui/src/platform/windows/window.rs @@ -701,12 +701,13 @@ impl WindowsWindowInner { if let Some(callback) = callbacks.input.as_mut() { let x = lparam.signed_loword() as f32; let y = lparam.signed_hiword() as f32; + let click_count = self.click_state.borrow().current_count; let scale_factor = self.scale_factor.get(); let event = MouseUpEvent { button, position: logical_point(x, y, scale_factor), modifiers: self.current_modifiers(), - click_count: 1, + click_count, }; if callback(PlatformInput::MouseUp(event)).default_prevented { return Some(0);