diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-12-06 12:55:25 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-01-18 16:20:45 +0100 |
commit | 18b8f9bfed6220640583b648e2fa4bcda4976365 (patch) | |
tree | 21b2fb48ddc19f2a8fe4bb6cec5548d9499a9be4 | |
parent | f08417b6183b7e8654fab877f467fa95bbfe4557 (diff) | |
download | mutter-18b8f9bfed6220640583b648e2fa4bcda4976365.tar.gz |
wayland: Bolt MetaWaylandTextInput in.
Offer the text-input interface global, so it can be used by clients. The
MetaWaylandSeat will also let MetaWaylandTextInput intercept key events
before the keyboard interface handles those.
-rw-r--r-- | src/wayland/meta-wayland-seat.c | 8 | ||||
-rw-r--r-- | src/wayland/meta-wayland.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index 68a21155b..dc013c002 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -225,6 +225,8 @@ meta_wayland_seat_new (MetaWaylandCompositor *compositor, "seat", seat, NULL); + seat->text_input = meta_wayland_text_input_new (seat); + meta_wayland_data_device_init (&seat->data_device); device_manager = clutter_device_manager_get_default (); @@ -260,6 +262,7 @@ meta_wayland_seat_free (MetaWaylandSeat *seat) g_object_unref (seat->pointer); g_object_unref (seat->keyboard); g_object_unref (seat->touch); + meta_wayland_text_input_destroy (seat->text_input); g_slice_free (MetaWaylandSeat, seat); } @@ -377,6 +380,9 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat, break; case CLUTTER_KEY_PRESS: case CLUTTER_KEY_RELEASE: + if (meta_wayland_text_input_handle_event (seat->text_input, event)) + return TRUE; + if (meta_wayland_seat_has_keyboard (seat)) return meta_wayland_keyboard_handle_event (seat->keyboard, (const ClutterKeyEvent *) event); @@ -419,6 +425,8 @@ meta_wayland_seat_set_input_focus (MetaWaylandSeat *seat, tablet_seat = meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat); meta_wayland_tablet_seat_set_pad_focus (tablet_seat, surface); + + meta_wayland_text_input_set_focus (seat->text_input, surface); } gboolean diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index adb34c214..050492baa 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -384,6 +384,7 @@ meta_wayland_init (void) meta_wayland_dma_buf_init (compositor); meta_wayland_keyboard_shortcuts_inhibit_init (compositor); meta_wayland_surface_inhibit_shortcuts_dialog_init (); + meta_wayland_text_input_init (compositor); /* Xwayland specific protocol, needs to be filtered out for all other clients */ if (meta_xwayland_grab_keyboard_init (compositor)) |