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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3707>
This commit is contained in:
parent
5ca10c31d1
commit
9bdb00c459
3 changed files with 6 additions and 6 deletions
|
@ -182,7 +182,7 @@ primary_device_set_selection (struct wl_client *client,
|
||||||
source = wl_resource_get_user_data (source_resource);
|
source = wl_resource_get_user_data (source_resource);
|
||||||
|
|
||||||
if (wl_resource_get_client (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)
|
if (source)
|
||||||
meta_wayland_data_source_cancel (source);
|
meta_wayland_data_source_cancel (source);
|
||||||
|
@ -211,7 +211,7 @@ owner_changed_cb (MetaSelection *selection,
|
||||||
struct wl_resource *data_device_resource;
|
struct wl_resource *data_device_resource;
|
||||||
struct wl_client *focus_client;
|
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)
|
if (!focus_client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -348,13 +348,13 @@ create_and_send_primary_offer (MetaWaylandDataDevicePrimary *data_device,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
MetaWaylandSeat *seat = wl_container_of (data_device, seat, primary_data_device);
|
||||||
struct wl_client *focus_client;
|
struct wl_client *focus_client;
|
||||||
struct wl_resource *data_device_resource;
|
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)
|
if (focus_client == data_device->focus_client)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -52,4 +52,4 @@ void meta_wayland_data_device_primary_manager_init (MetaWaylandCompositor *compo
|
||||||
void meta_wayland_data_device_primary_init (MetaWaylandDataDevicePrimary *data_device,
|
void meta_wayland_data_device_primary_init (MetaWaylandDataDevicePrimary *data_device,
|
||||||
MetaWaylandSeat *seat);
|
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);
|
||||||
|
|
|
@ -225,7 +225,7 @@ default_focus (MetaWaylandEventHandler *handler,
|
||||||
meta_wayland_keyboard_set_focus (seat->keyboard, surface);
|
meta_wayland_keyboard_set_focus (seat->keyboard, surface);
|
||||||
|
|
||||||
meta_wayland_data_device_sync_focus (&seat->data_device);
|
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_tablet_seat_set_pad_focus (seat->tablet_seat, surface);
|
||||||
meta_wayland_text_input_set_focus (seat->text_input, surface);
|
meta_wayland_text_input_set_focus (seat->text_input, surface);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue