@@ -463,8 +463,7 @@ impl WindowsPlatform {
463463 crate :: tsf:: composition_fsm:: CompositionEvent :: FocusChange { tsf_mode } ,
464464 None ,
465465 ) ;
466- let last_io = crate :: tsf:: observer:: gji_last_io_ms ( ) ;
467- let gji_idle_ms = crate :: hook:: current_tick_ms ( ) . saturating_sub ( last_io) ;
466+ let gji_idle_ms = crate :: tsf:: observer:: gji_idle_ms ( ) ;
468467 let resp = self . output . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: FocusChange {
469468 injection_mode,
470469 gji_idle_ms,
@@ -495,20 +494,21 @@ impl WindowsPlatform {
495494
496495 /// IME ON を GjiFsm に通知する(`on_ime_applied(open=true)` から呼ぶ)。
497496 pub ( crate ) fn gji_on_ime_on ( & mut self , injection_mode : crate :: output:: types:: InjectionMode ) {
498- let last_io = crate :: tsf:: observer:: gji_last_io_ms ( ) ;
499- let gji_idle_ms = crate :: hook:: current_tick_ms ( ) . saturating_sub ( last_io) ;
497+ let gji_idle_ms = crate :: tsf:: observer:: gji_idle_ms ( ) ;
500498 let resp = self
501499 . output
502500 . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: ImeOn { injection_mode, gji_idle_ms } ) ;
503501 self . dispatch_gji_response ( resp) ;
504502 }
505503
504+ fn dispatch_gji_event ( & mut self , event : crate :: tsf:: gji_fsm:: GjiEvent ) {
505+ let resp = self . output . gji_on_event ( event) ;
506+ self . dispatch_gji_response ( resp) ;
507+ }
508+
506509 /// IME OFF を GjiFsm に通知する(`on_ime_applied(open=false)` から呼ぶ)。
507510 pub ( crate ) fn gji_on_ime_off ( & mut self ) {
508- let resp = self
509- . output
510- . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: ImeOff ) ;
511- self . dispatch_gji_response ( resp) ;
511+ self . dispatch_gji_event ( crate :: tsf:: gji_fsm:: GjiEvent :: ImeOff ) ;
512512 }
513513
514514 /// TIMER_GJI_LONG_IDLE ハンドラ。LongIdle タイムアウトを GjiFsm に通知する。
@@ -522,21 +522,15 @@ impl WindowsPlatform {
522522 /// `on_passthrough_key` の PassthroughKey / F2NonTsf や
523523 /// `mark_cold_raw_tsf`(`step_probe` 経由)から呼ぶ。
524524 pub ( crate ) fn gji_on_composition_reset ( & mut self ) {
525- let resp = self
526- . output
527- . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: CompositionReset ) ;
528- self . dispatch_gji_response ( resp) ;
525+ self . dispatch_gji_event ( crate :: tsf:: gji_fsm:: GjiEvent :: CompositionReset ) ;
529526 }
530527
531528 /// TSF mode で物理 F2 が消費されたことを GjiFsm に通知する(`on_reinject_key` の NativeF2Consumed パス)。
532529 ///
533530 /// Medium/Long cold 中は probe が継続(saw_native_f2=true)。Short cold / OnWarm / OnComposing は
534531 /// CompositionReset 相当として処理される(GjiFsm 側で分岐)。
535532 pub ( crate ) fn gji_on_native_f2_consumed ( & mut self ) {
536- let resp = self
537- . output
538- . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: NativeF2Consumed ) ;
539- self . dispatch_gji_response ( resp) ;
533+ self . dispatch_gji_event ( crate :: tsf:: gji_fsm:: GjiEvent :: NativeF2Consumed ) ;
540534 }
541535
542536 /// GJI candidate SHOW → GjiFsm::StartComposition を dispatch する。
@@ -545,10 +539,7 @@ impl WindowsPlatform {
545539 /// `advance_tsf_probe` / `send_keys` で `take_pending_start_composition()` が true を返したときに呼ぶ。
546540 pub ( crate ) fn gji_on_start_composition ( & mut self ) {
547541 log:: debug!( "[gji-fsm] StartComposition (candidate SHOW)" ) ;
548- let resp = self
549- . output
550- . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: StartComposition ) ;
551- self . dispatch_gji_response ( resp) ;
542+ self . dispatch_gji_event ( crate :: tsf:: gji_fsm:: GjiEvent :: StartComposition ) ;
552543 }
553544
554545 /// GJI candidate HIDE → GjiFsm::EndComposition を dispatch する。
@@ -559,10 +550,7 @@ impl WindowsPlatform {
559550 pub ( crate ) fn gji_on_end_composition ( & mut self ) {
560551 if let Some ( epoch) = self . output . gji_current_composition_epoch ( ) {
561552 log:: debug!( "[gji-fsm] EndComposition (candidate HIDE) epoch={epoch:?}" ) ;
562- let resp = self
563- . output
564- . gji_on_event ( crate :: tsf:: gji_fsm:: GjiEvent :: EndComposition { epoch } ) ;
565- self . dispatch_gji_response ( resp) ;
553+ self . dispatch_gji_event ( crate :: tsf:: gji_fsm:: GjiEvent :: EndComposition { epoch } ) ;
566554 }
567555 }
568556
0 commit comments