[mutter] wayland/keyboard: Scope variable correctly



commit c2217373df153e3bdc165d2d6bae0930d76c9229
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Sep 20 16:52:29 2016 +0800

    wayland/keyboard: Scope variable correctly
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771646

 src/wayland/meta-wayland-keyboard.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index d62d737..b730479 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]