From 8a727c1e2185a7aecfb356a72c4ea24f0ecc332a Mon Sep 17 00:00:00 2001 From: Ethan Burns Date: Tue, 4 Nov 2025 17:33:31 -0500 Subject: [PATCH] Cancel compose when clicking the mouse on an alt+click. The alt key begins a compose. When using alt+click, compose was not previously cancelled and the next two typed characters would often end up composed. --- src/cmd/devdraw/wayland.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/devdraw/wayland.c b/src/cmd/devdraw/wayland.c index 0b13cf65..b574c6d0 100644 --- a/src/cmd/devdraw/wayland.c +++ b/src/cmd/devdraw/wayland.c @@ -589,6 +589,7 @@ void wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t seria if (wl->ctl) { mask = 1 << CTL_BUTTON; } else if (wl->alt) { + gfx_abortcompose(c); mask = 1 << ALT_BUTTON; } } @@ -724,7 +725,7 @@ void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, if (wayland_debug) { char name[256]; xkb_keysym_get_name(keysym, &name[0], 256); - char *state_str = WL_KEYBOARD_KEY_STATE_PRESSED ? "down" : "up"; + char *state_str = state == WL_KEYBOARD_KEY_STATE_PRESSED ? "down" : "up"; DEBUG("wl_keyboard_key: keysym=%s, rune=0x%x, state=%s\n", name, rune, state_str); } @@ -824,8 +825,9 @@ void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, &wl_callback_key_repeat_listener, c); } qunlock(&wayland_lock); - if (state == WL_KEYBOARD_KEY_STATE_PRESSED && rune != 0) + if (state == WL_KEYBOARD_KEY_STATE_PRESSED && rune != 0) { gfx_keystroke(c, rune); + } } void wl_keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard,