summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-04-04 21:10:18 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-04-04 21:14:53 -0400
commit086789d01508ad1c96b0d94935095022193dd1a8 (patch)
treef12521188bd5808235e396b361f847708e34e1a0
parenteff4be5673df5a85bb9b8656284975e80f19664a (diff)
downloadgtk+-086789d01508ad1c96b0d94935095022193dd1a8.tar.gz
wayland: Always initialize directions
I forgot to initialize directionm in gdk_wayland_keymap_new, leading to crash.
-rw-r--r--gdk/wayland/gdkkeys-wayland.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 83d94e9be5..f58d1b3e35 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,