[mutter/gnome-3-22] wayland/keyboard: Initialize static state in GObject init func



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

    wayland/keyboard: Initialize static state in GObject init func
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771646

 src/wayland/meta-wayland-keyboard.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 2b5e23c..fd32483 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -611,12 +611,8 @@ meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
   wl_list_init (&keyboard->resource_list);
   wl_list_init (&keyboard->focus_resource_list);
 
-  keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy;
-
   keyboard->xkb_info.keymap_fd = -1;
 
-  keyboard->default_grab.interface = &default_keyboard_grab_interface;
-  keyboard->default_grab.keyboard = keyboard;
   keyboard->grab = &keyboard->default_grab;
 
   keyboard->settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
@@ -961,6 +957,11 @@ meta_wayland_keyboard_end_grab (MetaWaylandKeyboard *keyboard)
 static void
 meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard)
 {
+  keyboard->default_grab.interface = &default_keyboard_grab_interface;
+  keyboard->default_grab.keyboard = keyboard;
+
+  keyboard->focus_surface_listener.notify =
+    keyboard_handle_focus_surface_destroy;
 }
 
 static void


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