diff --git a/data/keyboards/geometry/compact.xml b/data/keyboards/geometry/compact.xml
index 743b5bf8..67d46556 100644
--- a/data/keyboards/geometry/compact.xml
+++ b/data/keyboards/geometry/compact.xml
@@ -37,7 +37,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
diff --git a/eek/eek-xml-layout.c b/eek/eek-xml-layout.c
index 3dfc8988..947a091e 100644
--- a/eek/eek-xml-layout.c
+++ b/eek/eek-xml-layout.c
@@ -384,8 +384,6 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
}
if (g_strcmp0 (element_name, "key") == 0) {
- guint keycode;
-
attribute = get_attribute (attribute_names, attribute_values,
"name");
if (attribute == NULL) {
@@ -397,12 +395,7 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
}
gchar *name = g_strdup (attribute);
- attribute = get_attribute (attribute_names, attribute_values,
- "keycode");
- if (attribute != NULL)
- keycode = strtol (attribute, NULL, 10);
- else
- keycode = data->keycode++;
+ guint keycode = data->keycode++;
data->key = eek_section_create_key (data->section,
name,
@@ -441,6 +434,12 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
key,
g_strdup (attribute));
+ attribute = get_attribute (attribute_names, attribute_values,
+ "keycode");
+ if (attribute != NULL) {
+ eek_key_set_keycode(key, strtol (attribute, NULL, 10));
+ }
+
goto out;
}