From 276df8f18dca85b1e8eb2b9377414ec4709ec74e Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 16 Sep 2014 21:24:28 -0600 Subject: [PATCH] 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. --- src/wayland/meta-wayland-keyboard.c | 10 ++++++++-- src/wayland/meta-wayland-pointer.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 0c6b88fe3..068ab71d5 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -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); 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_KEYMAP_FORMAT_XKB_V1, @@ -646,5 +645,12 @@ meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard, notify_key_repeat_for_resource (keyboard, cr); if (keyboard->focus_surface && wl_resource_get_client (keyboard->focus_surface->resource) == client) - broadcast_focus (keyboard, cr); + { + wl_list_insert (&keyboard->focus_resource_list, wl_resource_get_link (cr)); + broadcast_focus (keyboard, cr); + } + else + { + wl_list_insert (&keyboard->resource_list, wl_resource_get_link (cr)); + } } diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 7677ae488..ca1952a0b 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -817,10 +817,16 @@ meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer, 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_list_insert (&pointer->resource_list, wl_resource_get_link (cr)); if (pointer->focus_surface && wl_resource_get_client (pointer->focus_surface->resource) == client) - broadcast_focus (pointer, cr); + { + wl_list_insert (&pointer->focus_resource_list, wl_resource_get_link (cr)); + broadcast_focus (pointer, cr); + } + else + { + wl_list_insert (&pointer->resource_list, wl_resource_get_link (cr)); + } } gboolean