From 9bdb00c4594fd929937ed62dd5f5e96d22576fea Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 15 Apr 2024 22:38:40 +0200 Subject: [PATCH] wayland: Follow seat's input focus client for primary selections The concept of "input focus" will exist regardless of a MetaWaylandKeyboard being available or not, use the seat's focus for that. Part-of: --- src/wayland/meta-wayland-data-device-primary.c | 8 ++++---- src/wayland/meta-wayland-data-device-primary.h | 2 +- src/wayland/meta-wayland-seat.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wayland/meta-wayland-data-device-primary.c b/src/wayland/meta-wayland-data-device-primary.c index 53fbda439..3e20f4be8 100644 --- a/src/wayland/meta-wayland-data-device-primary.c +++ b/src/wayland/meta-wayland-data-device-primary.c @@ -182,7 +182,7 @@ primary_device_set_selection (struct wl_client *client, source = wl_resource_get_user_data (source_resource); if (wl_resource_get_client (resource) != - meta_wayland_keyboard_get_focus_client (seat->keyboard)) + meta_wayland_seat_get_input_focus_client (seat)) { if (source) meta_wayland_data_source_cancel (source); @@ -211,7 +211,7 @@ owner_changed_cb (MetaSelection *selection, struct wl_resource *data_device_resource; struct wl_client *focus_client; - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); + focus_client = meta_wayland_seat_get_input_focus_client (seat); if (!focus_client) return; @@ -348,13 +348,13 @@ create_and_send_primary_offer (MetaWaylandDataDevicePrimary *data_device, } void -meta_wayland_data_device_primary_set_keyboard_focus (MetaWaylandDataDevicePrimary *data_device) +meta_wayland_data_device_primary_sync_focus (MetaWaylandDataDevicePrimary *data_device) { MetaWaylandSeat *seat = wl_container_of (data_device, seat, primary_data_device); struct wl_client *focus_client; struct wl_resource *data_device_resource; - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); + focus_client = meta_wayland_seat_get_input_focus_client (seat); if (focus_client == data_device->focus_client) return; diff --git a/src/wayland/meta-wayland-data-device-primary.h b/src/wayland/meta-wayland-data-device-primary.h index 3ac00dba7..e6866122c 100644 --- a/src/wayland/meta-wayland-data-device-primary.h +++ b/src/wayland/meta-wayland-data-device-primary.h @@ -52,4 +52,4 @@ void meta_wayland_data_device_primary_manager_init (MetaWaylandCompositor *compo void meta_wayland_data_device_primary_init (MetaWaylandDataDevicePrimary *data_device, MetaWaylandSeat *seat); -void meta_wayland_data_device_primary_set_keyboard_focus (MetaWaylandDataDevicePrimary *data_device); +void meta_wayland_data_device_primary_sync_focus (MetaWaylandDataDevicePrimary *data_device); diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index 99b763348..f8d58a612 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -225,7 +225,7 @@ default_focus (MetaWaylandEventHandler *handler, meta_wayland_keyboard_set_focus (seat->keyboard, surface); meta_wayland_data_device_sync_focus (&seat->data_device); - meta_wayland_data_device_primary_set_keyboard_focus (&seat->primary_data_device); + meta_wayland_data_device_primary_sync_focus (&seat->primary_data_device); meta_wayland_tablet_seat_set_pad_focus (seat->tablet_seat, surface); meta_wayland_text_input_set_focus (seat->text_input, surface); }