From 15a4ad4c389a0ae9bad3684b93e1f21b89fccc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 20 Sep 2016 16:52:29 +0800 Subject: [PATCH] wayland/keyboard: Scope variable correctly https://bugzilla.gnome.org/show_bug.cgi?id=771646 --- src/wayland/meta-wayland-keyboard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index d62d7378d..b730479c0 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -832,10 +832,9 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard, if (keyboard->focus_surface != NULL) { - struct wl_resource *resource; - if (!wl_list_empty (&keyboard->focus_resource_list)) { + struct wl_resource *resource; uint32_t serial; serial = meta_wayland_input_device_next_serial (input_device); @@ -854,7 +853,7 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard, if (surface != NULL) { - struct wl_resource *resource; + struct wl_resource *focus_surface_resource; keyboard->focus_surface = surface; wl_resource_add_destroy_listener (keyboard->focus_surface->resource, &keyboard->focus_surface_listener); @@ -865,6 +864,8 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard, if (!wl_list_empty (&keyboard->focus_resource_list)) { + struct wl_resource *resource; + keyboard->focus_serial = meta_wayland_input_device_next_serial (input_device);