@@ -27,6 +27,7 @@ pub(crate) const WM_GPUI_FORCE_UPDATE_WINDOW: u32 = WM_USER + 5;
2727pub ( crate ) const WM_GPUI_KEYBOARD_LAYOUT_CHANGED : u32 = WM_USER + 6 ;
2828pub ( crate ) const WM_GPUI_GPU_DEVICE_LOST : u32 = WM_USER + 7 ;
2929pub ( crate ) const WM_GPUI_KEYDOWN : u32 = WM_USER + 8 ;
30+ pub ( crate ) const WM_GPUI_ACCEPTS_TEXT_INPUT : u32 = WM_USER + 9 ;
3031
3132const SIZE_MOVE_LOOP_TIMER_ID : usize = 1 ;
3233const AUTO_HIDE_TASKBAR_THICKNESS_PX : i32 = 1 ;
@@ -106,6 +107,7 @@ impl WindowsWindowInner {
106107 WM_GPUI_CURSOR_STYLE_CHANGED => self . handle_cursor_changed ( lparam) ,
107108 WM_GPUI_FORCE_UPDATE_WINDOW => self . draw_window ( handle, true ) ,
108109 WM_GPUI_GPU_DEVICE_LOST => self . handle_device_lost ( lparam) ,
110+ WM_GPUI_ACCEPTS_TEXT_INPUT => self . has_input_handler ( ) ,
109111 _ => None ,
110112 } ;
111113 if let Some ( n) = handled {
@@ -1131,6 +1133,15 @@ impl WindowsWindowInner {
11311133 Some ( 0 )
11321134 }
11331135
1136+ fn has_input_handler ( & self ) -> Option < isize > {
1137+ let mut state = self . state . borrow_mut ( ) ;
1138+ let has_enabled_handler = state
1139+ . input_handler
1140+ . as_mut ( )
1141+ . map_or ( false , |handler| handler. accepts_text_input ( ) ) ;
1142+ Some ( if has_enabled_handler { 1 } else { 0 } )
1143+ }
1144+
11341145 #[ inline]
11351146 fn draw_window ( & self , handle : HWND , force_render : bool ) -> Option < isize > {
11361147 let mut request_frame = self . state . borrow_mut ( ) . callbacks . request_frame . take ( ) ?;
0 commit comments