Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix early dispatch crash on windows (#36445)
localcc97f784dedf58
diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rsindex 4ab257d27a6..9b25ab360ea 100644--- a/crates/gpui/src/platform/windows/events.rs+++ b/crates/gpui/src/platform/windows/events.rs@@ -100,6 +100,7 @@ impl WindowsWindowInner {WM_SETCURSOR => self.handle_set_cursor(handle, lparam),WM_SETTINGCHANGE => self.handle_system_settings_changed(handle, wparam, lparam),WM_INPUTLANGCHANGE => self.handle_input_language_changed(lparam),+ WM_SHOWWINDOW => self.handle_window_visibility_changed(handle, wparam),WM_GPUI_CURSOR_STYLE_CHANGED => self.handle_cursor_changed(lparam),WM_GPUI_FORCE_UPDATE_WINDOW => self.draw_window(handle, true),_ => None,@@ -1160,6 +1161,13 @@ impl WindowsWindowInner {Some(0)}+ fn handle_window_visibility_changed(&self, handle: HWND, wparam: WPARAM) -> Option<isize> {+ if wparam.0 == 1 {+ self.draw_window(handle, false);+ }+ None+ }+fn handle_device_change_msg(&self, handle: HWND, wparam: WPARAM) -> Option<isize> {if wparam.0 == DBT_DEVNODES_CHANGED as usize {// The reason for sending this message is to actually trigger a redraw of the window.