Modified to call unbind function when resource already exists in bind function 06/106306/2
authorInHong Han <inhong1.han@samsung.com>
Wed, 21 Dec 2016 08:52:32 +0000 (17:52 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 21 Dec 2016 09:16:28 +0000 (18:16 +0900)
Change-Id: I0e600750d6cb9459f25b2e2dfcff8171a3d21dc5

src/e_mod_input_panel.c
src/e_mod_main.c

index 8e6ab11..d4e45ef 100644 (file)
@@ -597,6 +597,9 @@ _e_input_panel_bind(struct wl_client *client, void *data, uint32_t version EINA_
 
    if (!input_panel) return;
 
+   if (input_panel->resource)
+     _e_input_panel_unbind(input_panel->resource);
+
    resource = wl_resource_create(client, &wl_input_panel_interface, 1, id);
    if (!resource) return;
 
@@ -612,7 +615,7 @@ _e_input_panel_bind(struct wl_client *client, void *data, uint32_t version EINA_
      }
 
    wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                          "interface object already bound");
+                          "input_panel object already bound");
 }
 
 void
index a8a70e1..6cba64f 100644 (file)
@@ -1813,9 +1813,12 @@ _e_text_cb_bind_input_method(struct wl_client *client, void *data, uint32_t vers
      return;
 
    if (input_method->resource)
+     _e_text_input_method_cb_unbind(input_method->resource);
+
+   if (input_method->resource)
      {
         wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                               "interface object already bound");
+                               "input_method object already bound");
         return;
      }