diff --git a/src/xwindows/keyboard.rs b/src/xwindows/keyboard.rs index 0bff54fd7..6e901f0a0 100644 --- a/src/xwindows/keyboard.rs +++ b/src/xwindows/keyboard.rs @@ -102,15 +102,16 @@ impl Keyboard { &self, xcb_ev: &xcb::KeyPressEvent, ) -> Option<(KeyCode, KeyModifiers)> { - let xcode = xcb_ev.detail() as xkb::Keycode; - let xsym = self.state.borrow().key_get_one_sym(xcode); let pressed = (xcb_ev.response_type() & !0x80) == xcb::KEY_PRESS; - if pressed { - self.compose_state.borrow_mut().feed(xsym); - } else { + + if ! pressed { return None; } + let xcode = xcb_ev.detail() as xkb::Keycode; + let xsym = self.state.borrow().key_get_one_sym(xcode); + self.compose_state.borrow_mut().feed(xsym); + let cstate = self.compose_state.borrow().status().clone(); let ksym = match cstate { ComposeStatus::Composing => {