[gtk+] wayland: Always initialize directions



commit 086789d01508ad1c96b0d94935095022193dd1a8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Apr 4 21:10:18 2013 -0400

    wayland: Always initialize directions
    
    I forgot to initialize directionm in gdk_wayland_keymap_new,
    leading to crash.

 gdk/wayland/gdkkeys-wayland.c |   48 +++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 23 deletions(-)
---
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 83d94e9..f58d1b3 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -225,29 +225,6 @@ _gdk_wayland_keymap_init (GdkWaylandKeymap *keymap)
 {
 }
 
-GdkKeymap *
-_gdk_wayland_keymap_new ()
-{
-  GdkWaylandKeymap *keymap;
-  struct xkb_context *context;
-  struct xkb_rule_names names;
-
-  keymap = g_object_new (_gdk_wayland_keymap_get_type(), NULL);
-
-  context = xkb_context_new (0);
-
-  names.rules = "evdev";
-  names.model = "pc105";
-  names.layout = "us";
-  names.variant = "";
-  names.options = "";
-  keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0);
-  keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
-  xkb_context_unref (context);
-
-  return GDK_KEYMAP (keymap);
-}
-
 static void
 update_direction (GdkWaylandKeymap *keymap)
 {
@@ -317,6 +294,31 @@ update_direction (GdkWaylandKeymap *keymap)
   g_free (rtl);
 }
 
+GdkKeymap *
+_gdk_wayland_keymap_new ()
+{
+  GdkWaylandKeymap *keymap;
+  struct xkb_context *context;
+  struct xkb_rule_names names;
+
+  keymap = g_object_new (_gdk_wayland_keymap_get_type(), NULL);
+
+  context = xkb_context_new (0);
+
+  names.rules = "evdev";
+  names.model = "pc105";
+  names.layout = "us";
+  names.variant = "";
+  names.options = "";
+  keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0);
+  keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
+  xkb_context_unref (context);
+
+  update_direction (keymap);
+
+  return GDK_KEYMAP (keymap);
+}
+
 void
 _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
                                     uint32_t   format,


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