Prevent duplicated surfaces being appended to list 47/122147/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 30 Mar 2017 09:00:50 +0000 (18:00 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 30 Mar 2017 09:01:01 +0000 (18:01 +0900)
Change-Id: I5cda313dd1aad4736351df56893078c5a70ec635

src/e_mod_input_panel.c

index 1fe99a6cca6759ee8204f81c02eb7d7116ec2550..1bd03a376b1b0a51013ca7f808dc0997febb71d7 100644 (file)
@@ -88,7 +88,12 @@ _e_input_panel_surface_cb_toplevel_set(struct wl_client *client EINA_UNUSED, str
 
    if (!(input_panel = ips->input_panel)) return;
 
-   _e_input_panel_surface_append(input_panel, ips);
+   /* Do not append duplicated surface - And need to check if the surface really needs to be appended here,
+    * since the newly created surface is already being appended at function _e_input_panel_cb_surface_get() */
+   if (eina_list_data_find(input_panel->surfaces, ips) != ips)
+     {
+        _e_input_panel_surface_append(input_panel, ips);
+     }
    ips->panel = EINA_FALSE;
 }
 
@@ -108,7 +113,12 @@ _e_input_panel_surface_cb_overlay_panel_set(struct wl_client *client EINA_UNUSED
 
    if (!(input_panel = ips->input_panel)) return;
 
-   _e_input_panel_surface_append(input_panel, ips);
+   /* Do not append duplicated surface - And need to check if the surface really needs to be appended here,
+   * since the newly created surface is already being appended at function _e_input_panel_cb_surface_get() */
+   if (eina_list_data_find(input_panel->surfaces, ips) != ips)
+     {
+        _e_input_panel_surface_append(input_panel, ips);
+     }
    ips->panel = EINA_TRUE;
 }