Skip to content

Commit

Permalink
strip disable evnet
Browse files Browse the repository at this point in the history
  • Loading branch information
garasubo committed Nov 16, 2020
1 parent 02ea93e commit 0684ebd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/platform_impl/linux/x11/event_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,12 +1229,18 @@ impl<T: 'static> EventProcessor<T> {
}
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) => {
Expand All @@ -1254,7 +1260,6 @@ impl<T: 'static> EventProcessor<T> {
)),
});
}
_ => {}
},
Err(_) => (),
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/x11/ime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub enum ImeEvent {
Start,
Update(String, usize),
End,
Disabled,
}

pub type ImeReceiver = Receiver<(ffi::Window, i16, i16)>;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0684ebd

Please sign in to comment.