1
0
Fork 0

keyboard/pointer: Make sure to move focused resources into the list

We only broadcast input to the focus_resource_list, so we need to make
sure it's put in the proper list on startup.

This fixes input not working for windows when they first appear.

Argh. There's always more stuff to fix with keyboard/pointer. Every
single time I think I've fixed it, more stuff pops up.
This commit is contained in:
Jasper St. Pierre 2014-09-16 21:24:28 -06:00
parent d61dde12cb
commit 276df8f18d
2 changed files with 16 additions and 4 deletions

View file

@ -636,7 +636,6 @@ meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard,
cr = wl_resource_create (client, &wl_keyboard_interface, wl_resource_get_version (seat_resource), id); cr = wl_resource_create (client, &wl_keyboard_interface, wl_resource_get_version (seat_resource), id);
wl_resource_set_implementation (cr, &keyboard_interface, keyboard, unbind_resource); wl_resource_set_implementation (cr, &keyboard_interface, keyboard, unbind_resource);
wl_list_insert (&keyboard->resource_list, wl_resource_get_link (cr));
wl_keyboard_send_keymap (cr, wl_keyboard_send_keymap (cr,
WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
@ -646,5 +645,12 @@ meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard,
notify_key_repeat_for_resource (keyboard, cr); notify_key_repeat_for_resource (keyboard, cr);
if (keyboard->focus_surface && wl_resource_get_client (keyboard->focus_surface->resource) == client) if (keyboard->focus_surface && wl_resource_get_client (keyboard->focus_surface->resource) == client)
{
wl_list_insert (&keyboard->focus_resource_list, wl_resource_get_link (cr));
broadcast_focus (keyboard, cr); broadcast_focus (keyboard, cr);
} }
else
{
wl_list_insert (&keyboard->resource_list, wl_resource_get_link (cr));
}
}

View file

@ -817,11 +817,17 @@ meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
cr = wl_resource_create (client, &wl_pointer_interface, wl_resource_get_version (seat_resource), id); cr = wl_resource_create (client, &wl_pointer_interface, wl_resource_get_version (seat_resource), id);
wl_resource_set_implementation (cr, &pointer_interface, pointer, unbind_resource); wl_resource_set_implementation (cr, &pointer_interface, pointer, unbind_resource);
wl_list_insert (&pointer->resource_list, wl_resource_get_link (cr));
if (pointer->focus_surface && wl_resource_get_client (pointer->focus_surface->resource) == client) if (pointer->focus_surface && wl_resource_get_client (pointer->focus_surface->resource) == client)
{
wl_list_insert (&pointer->focus_resource_list, wl_resource_get_link (cr));
broadcast_focus (pointer, cr); broadcast_focus (pointer, cr);
} }
else
{
wl_list_insert (&pointer->resource_list, wl_resource_get_link (cr));
}
}
gboolean gboolean
meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer, meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,