mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 12:52:14 +00:00
core: Change MetaWaylandTextInput event forwarding to IMs
We need to juggle with some things here to keep key event ordering and accounting consistent. The keyboard internal state changes (and maybe modifier event emission) happening through meta_wayland_seat_update() should ideally happen from the same key events that reach the client through wl_keyboard.key, so that wl_keyboard.modifier events are emitted in the right relative order to other key events. In order to fix this, we need to decide at an earlier point whether the event will get processed through IM (and maybe be reinjected), thus ignored in wait of IM-postprocessed events. This means we pay less attention to whether events are first-hand hardware events for some things and go with the event that does eventually reach to us (hardware or IM). Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5890 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3044>
This commit is contained in:
parent
eaa09be17c
commit
bc04fcb89d
@ -226,10 +226,16 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
gboolean has_grab;
|
gboolean has_grab;
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
MetaWaylandCompositor *wayland_compositor;
|
MetaWaylandCompositor *wayland_compositor;
|
||||||
|
MetaWaylandTextInput *wayland_text_input = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
wayland_compositor = meta_context_get_wayland_compositor (context);
|
wayland_compositor = meta_context_get_wayland_compositor (context);
|
||||||
|
if (wayland_compositor)
|
||||||
|
{
|
||||||
|
wayland_text_input =
|
||||||
|
meta_wayland_compositor_get_text_input (wayland_compositor);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
COGL_TRACE_BEGIN_SCOPED (MetaDisplayHandleEvent,
|
COGL_TRACE_BEGIN_SCOPED (MetaDisplayHandleEvent,
|
||||||
@ -278,6 +284,15 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
|
if (wayland_text_input &&
|
||||||
|
!has_grab &&
|
||||||
|
!meta_compositor_get_current_window_drag (compositor) &&
|
||||||
|
meta_wayland_text_input_update (wayland_text_input, event))
|
||||||
|
{
|
||||||
|
bypass_wayland = bypass_clutter = TRUE;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (wayland_compositor)
|
if (wayland_compositor)
|
||||||
meta_wayland_compositor_update (wayland_compositor, event);
|
meta_wayland_compositor_update (wayland_compositor, event);
|
||||||
#endif
|
#endif
|
||||||
|
@ -384,9 +384,6 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
|||||||
break;
|
break;
|
||||||
case CLUTTER_KEY_PRESS:
|
case CLUTTER_KEY_PRESS:
|
||||||
case CLUTTER_KEY_RELEASE:
|
case CLUTTER_KEY_RELEASE:
|
||||||
if (meta_wayland_text_input_update (seat->text_input, event))
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
if (meta_wayland_seat_has_keyboard (seat))
|
if (meta_wayland_seat_has_keyboard (seat))
|
||||||
return meta_wayland_keyboard_handle_event (seat->keyboard,
|
return meta_wayland_keyboard_handle_event (seat->keyboard,
|
||||||
(const ClutterKeyEvent *) event);
|
(const ClutterKeyEvent *) event);
|
||||||
|
Loading…
Reference in New Issue
Block a user