mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
input: keyboard_leave: reset focused *before* doing anything else
And update xcursor. This is necessary since we may still have mouse focus. But without keyboard focus, we don't display the 'text' xcursor.
This commit is contained in:
parent
876cd6895f
commit
6b9837056e
1 changed files with 6 additions and 4 deletions
10
input.c
10
input.c
|
|
@ -147,21 +147,23 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
|
|||
surface == NULL || /* Seen on Sway 1.2 */
|
||||
wayl_terminal_from_surface(wayl, surface) == wayl->focused);
|
||||
|
||||
struct terminal *old_focused = wayl->focused;
|
||||
wayl->focused = NULL;
|
||||
|
||||
stop_repeater(wayl, -1);
|
||||
if (wayl->focused != NULL) {
|
||||
if (old_focused != NULL) {
|
||||
/*
|
||||
* Sway bug - under certain conditions we get a
|
||||
* keyboard_leave() (and keyboard_key()) without first having
|
||||
* received a keyboard_enter()
|
||||
*/
|
||||
term_focus_out(wayl->focused);
|
||||
term_focus_out(old_focused);
|
||||
term_xcursor_update(old_focused);
|
||||
} else {
|
||||
LOG_WARN(
|
||||
"compositor sent keyboard_leave event without a keyboard_enter "
|
||||
"event: surface=%p", surface);
|
||||
}
|
||||
|
||||
wayl->focused = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue