e_comp_wl_data: Don't send wl_data_selection event when focus changed 46/317546/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 11 Sep 2024 09:55:44 +0000 (18:55 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 11 Sep 2024 10:48:58 +0000 (19:48 +0900)
When focus changed, e20 check the focused app and send wl_data_selection event.
But now if the secondary selection apps get focus, don't send wl_data_selection event.

Change-Id: I2d852c4fd010f9dc43c4a503b6d52161d852fe5f

src/bin/server/e_comp_wl_data.c

index c6c9bd6..b247249 100644 (file)
@@ -1480,6 +1480,32 @@ e_comp_wl_data_device_send_offer(E_Client *ec)
    return offer_res;
 }
 
+static Eina_Bool
+_e_comp_wl_data_secondary_list_resource_check(struct wl_resource *data_device_res)
+{
+   struct wl_resource *data_device_res_tmp;
+   E_Client *tmp;
+   Eina_List *l;
+   E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+   if (comp_wl->selection.secondary_list == NULL)
+     return EINA_FALSE;
+
+   EINA_LIST_FOREACH(comp_wl->selection.secondary_list, l, tmp)
+     {
+        struct wl_resource *surface = e_comp_wl_client_surface_get(tmp);
+        if (!surface) continue;
+
+        data_device_res_tmp = e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
+        if (!data_device_res_tmp) continue;
+
+        if (data_device_res_tmp == data_device_res)
+          return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
 EINTERN void
 e_comp_wl_data_device_keyboard_focus_set(void)
 {
@@ -1511,6 +1537,8 @@ e_comp_wl_data_device_keyboard_focus_set(void)
       eina_list_remove(comp_wl->selection.data_only_list,
                        data_device_res);
 
+   if (_e_comp_wl_data_secondary_list_resource_check(data_device_res)) return;
+
    if (source && !source->is_manual)
      {
         offer_res =