check the result of ecore_x_window_prop_card32_get
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 7 Dec 2012 09:16:36 +0000 (18:16 +0900)
committerHaifeng Deng <haifeng.deng@samsung.com>
Thu, 13 Dec 2012 06:09:27 +0000 (14:09 +0800)
Change-Id: If8559827b4541f9783d3d34e1a69906cfbfdabc6

ism/extras/efl_setting/isf_setting_efl.cpp

index b01b0e49c35bed55dbbbcd1ffb33861e753b451a..0dfa33b82f76e286bb18775c703720784137fc8f 100755 (executable)
@@ -1438,14 +1438,16 @@ extern "C"
 
         String uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (SCIM_COMPOSE_KEY_FACTORY_UUID));
         TOOLBAR_MODE_T type = (TOOLBAR_MODE_T)scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_TYPE), TOOLBAR_KEYBOARD_MODE);
-        ecore_x_window_prop_card32_get (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &_hw_kbd_num, 1);
-        if (_hw_kbd_num != 0) {
-            if (type != TOOLBAR_KEYBOARD_MODE) {
-                _config->write (String (SCIM_CONFIG_DEFAULT_HELPER_ISE), uuid);
-                _config->flush ();
-                uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID);
+        if (ecore_x_window_prop_card32_get (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &_hw_kbd_num, 1) > 0) {
+            if (_hw_kbd_num != 0) {
+                if (type != TOOLBAR_KEYBOARD_MODE) {
+                    _config->write (String (SCIM_CONFIG_DEFAULT_HELPER_ISE), uuid);
+                    _config->flush ();
+                    uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID);
+                }
             }
         }
+
         isf_control_set_active_ise_by_uuid (uuid.c_str ());
 
         String mdl_name;