mirror of
https://github.com/brl/mutter.git
synced 2025-08-05 08:04:50 +00:00
wayland: Move device seat association to MetaWaylandInputDevice
Make the device <-> seat association permanent, and move it into MetaWaylandInputDevice. A device will never be disassociated with a seat, so there is no point in unsetting it. https://bugzilla.gnome.org/show_bug.cgi?id=771305
This commit is contained in:
@@ -351,11 +351,15 @@ meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
|
||||
struct wl_resource *resource;
|
||||
struct wl_list *l;
|
||||
|
||||
|
||||
l = &keyboard->focus_resource_list;
|
||||
if (!wl_list_empty (l))
|
||||
{
|
||||
uint32_t serial = wl_display_next_serial (keyboard->seat->wl_display);
|
||||
MetaWaylandInputDevice *input_device =
|
||||
META_WAYLAND_INPUT_DEVICE (keyboard);
|
||||
MetaWaylandSeat *seat = meta_wayland_input_device_get_seat (input_device);
|
||||
uint32_t serial;
|
||||
|
||||
serial = wl_display_next_serial (seat->wl_display);
|
||||
|
||||
wl_resource_for_each (resource, l)
|
||||
keyboard_send_modifiers (keyboard, resource, serial);
|
||||
@@ -602,14 +606,11 @@ static const MetaWaylandKeyboardGrabInterface default_keyboard_grab_interface =
|
||||
};
|
||||
|
||||
void
|
||||
meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard,
|
||||
MetaWaylandSeat *seat)
|
||||
meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
GSettingsSchema *schema;
|
||||
|
||||
keyboard->seat = seat;
|
||||
|
||||
wl_list_init (&keyboard->resource_list);
|
||||
wl_list_init (&keyboard->focus_resource_list);
|
||||
|
||||
@@ -677,8 +678,6 @@ meta_wayland_keyboard_disable (MetaWaylandKeyboard *keyboard)
|
||||
g_clear_object (&keyboard->settings);
|
||||
if (keyboard->gsd_settings)
|
||||
g_object_unref (keyboard->gsd_settings);
|
||||
|
||||
keyboard->seat = NULL;
|
||||
}
|
||||
|
||||
static guint
|
||||
@@ -826,7 +825,10 @@ void
|
||||
meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
if (keyboard->seat == NULL)
|
||||
MetaWaylandInputDevice *input_device = META_WAYLAND_INPUT_DEVICE (keyboard);
|
||||
MetaWaylandSeat *seat = meta_wayland_input_device_get_seat (input_device);
|
||||
|
||||
if (!meta_wayland_seat_has_keyboard (seat))
|
||||
return;
|
||||
|
||||
if (keyboard->focus_surface == surface)
|
||||
|
Reference in New Issue
Block a user