Compile a keymap using rmlvo if a cached file is invaild 35/60235/3
authorJengHyun Kang <jhyuni.kang@samsung.com>
Wed, 24 Feb 2016 08:44:16 +0000 (17:44 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 26 Feb 2016 05:44:00 +0000 (21:44 -0800)
Change-Id: I8be6c984d6599ad3c79b0adf746db2bd68196768

src/bin/e_comp_wl_input.c

index 9a1d6d651d9ef9665601d987bac470766b43c2f1..e1c4c5eea8fed15c9ba45ba96d306e48a3a39bc3 100644 (file)
@@ -732,9 +732,19 @@ e_comp_wl_input_keymap_compile(struct xkb_context *ctx, struct xkb_rule_names na
      {
         INF("Keymap file (%s) has been found. xkb_keymap is going to be generated with it.\n", cache_path);
         keymap = xkb_map_new_from_file(ctx, file, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
-        eina_stringshare_del(cache_path);
-        cache_path = NULL;
-        fclose(file);
+        if (!keymap)
+          {
+             WRN("Keymap file is exist (%s) but it is invaild file. Generate keymap using rmlvo\n", cache_path);
+             fclose(file);
+             remove(cache_path);
+             keymap = xkb_map_new_from_names(ctx, &names, 0);
+          }
+        else
+          {
+             eina_stringshare_del(cache_path);
+             cache_path = NULL;
+             fclose(file);
+          }
      }
 
    *keymap_path = cache_path;