Fix early dispatch crash on windows (#36445)

Closes #36384

Release Notes:

- N/A
This commit is contained in:
localcc 2025-08-18 23:30:02 +02:00 committed by GitHub
parent c5991e74bb
commit 97f784dedf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.