From 0684ebd5fcde2d551eed3b23c23de779e0d7521b Mon Sep 17 00:00:00 2001 From: garasubo Date: Mon, 16 Nov 2020 23:00:18 +0900 Subject: [PATCH] strip disable evnet --- src/platform_impl/linux/x11/event_processor.rs | 9 +++++++-- src/platform_impl/linux/x11/ime/mod.rs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/platform_impl/linux/x11/event_processor.rs b/src/platform_impl/linux/x11/event_processor.rs index 6590e28ed2c..4ca8814886f 100644 --- a/src/platform_impl/linux/x11/event_processor.rs +++ b/src/platform_impl/linux/x11/event_processor.rs @@ -1229,12 +1229,18 @@ impl EventProcessor { } match self.ime_event_receiver.try_recv() { Ok((window, event)) => match event { + ImeEvent::Enabled => { + callback(Event::WindowEvent { + window_id: mkwid(window), + event: WindowEvent::IME(IMEEvent::Enabled), + }); + } ImeEvent::Start => { self.is_composing = true; self.composed_text = None; callback(Event::WindowEvent { window_id: mkwid(window), - event: WindowEvent::IME(IMEEvent::PreeditStart("".to_owned())), + event: WindowEvent::IME(IMEEvent::Preedit("".to_owned(), None, None)), }); } ImeEvent::Update(text, position) => { @@ -1254,7 +1260,6 @@ impl EventProcessor { )), }); } - _ => {} }, Err(_) => (), } diff --git a/src/platform_impl/linux/x11/ime/mod.rs b/src/platform_impl/linux/x11/ime/mod.rs index ef18237e8fb..f51104b7f98 100644 --- a/src/platform_impl/linux/x11/ime/mod.rs +++ b/src/platform_impl/linux/x11/ime/mod.rs @@ -26,7 +26,6 @@ pub enum ImeEvent { Start, Update(String, usize), End, - Disabled, } pub type ImeReceiver = Receiver<(ffi::Window, i16, i16)>; @@ -107,6 +106,7 @@ impl Ime { // Create empty entry in map, so that when IME is rebuilt, this window has a context. None } else { + self.inner.event_sender.send((window, ImeEvent::Enabled)).expect("Failed to send enabled event"); Some(unsafe { ImeContext::new( &self.inner.xconn,