e_comp_wl: dnd with touch interface and modified drag window info 20/55120/1
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 22 Dec 2015 04:48:44 +0000 (13:48 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Tue, 22 Dec 2015 04:56:10 +0000 (13:56 +0900)
Send drop event with touch interface

Change-Id: I0d6cd2e9ae6e2e7572b0d65538936aa39bf17f4d

src/bin/e_comp_wl.c
src/bin/e_comp_wl_data.c
src/bin/e_comp_wl_data.h

index 178aed9fba55b7ee6f83586dc6df379f9611177d..5d7998cd4778d1bcb6cc74c1d080dbc25d6e2446 100644 (file)
@@ -974,6 +974,12 @@ _e_comp_wl_evas_handle_mouse_button_to_touch(E_Client *ec, uint32_t timestamp, i
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (!ec->comp_data->surface) return;
 
+   if (e_comp->wl_comp_data->dnd.enabled)
+     {
+        e_comp_wl_data_dnd_drop_touch(ec, timestamp, canvas_x, canvas_y, flag);
+        return;
+     }
+
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
 
index 566cb2d06e414ecf3a26e673ae68f48fb65fc6b3..b9e505139ffaab745de08349df7f512528738960 100644 (file)
@@ -374,8 +374,7 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
              ec->lock_focus_out = ec->layer_block = ec->visible = ec->override = 1;
              ec->new_client = 0;
              e_comp->new_clients--;
-             ec->icccm.title = eina_stringshare_add("noshadow");
-             ec->icccm.window_role = eina_stringshare_add("wl_pointer-cursor");
+             ec->icccm.title = eina_stringshare_add("drag-win");
              evas_object_pass_events_set(ec->frame, 1);
              ec->client.w = ec->client.h = 1;
              l = e_client_focus_stack_get();
@@ -985,3 +984,54 @@ e_comp_wl_data_dnd_drop(E_Client *ec, unsigned int time, uint32_t btn, uint32_t
           }
      }
 }
+
+EINTERN void
+e_comp_wl_data_dnd_drop_touch(E_Client *ec,
+                              unsigned int time,
+                              int x, int y,
+                              Eina_Bool flag)
+{
+   E_Comp_Data *cdata;
+   struct wl_resource *data_device_res, *res;
+   struct wl_client *wc;
+   uint32_t serial;
+   Eina_List *l;
+   wl_fixed_t fx, fy;
+
+   cdata = e_comp->wl_comp_data;
+   if (!cdata->dnd.focus) return;
+
+   data_device_res = _e_comp_wl_data_find_for_client(cdata->mgr.data_resources,
+                                                     wl_resource_get_client(cdata->dnd.focus));
+   if (!data_device_res) return;
+
+
+   if (!flag)
+     {
+        wl_data_device_send_drop(data_device_res);
+        e_comp_wl_data_dnd_focus(NULL);
+        if (cdata->dnd.data_source)
+          wl_list_remove(&cdata->dnd.data_source_listener.link);
+        cdata->dnd.enabled = 0;
+
+        wc = wl_resource_get_client(ec->comp_data->surface);
+        serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+
+        fx = wl_fixed_from_int(x - ec->client.x);
+        fy = wl_fixed_from_int(y - ec->client.y);
+
+        EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+          {
+             if (!e_comp_wl_input_pointer_check(res)) continue;
+             if (wl_resource_get_client(res) != wc) continue;
+             wl_pointer_send_enter(res, serial, ec->comp_data->surface, fx, fy);
+          }
+
+        EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
+          {
+             if (wl_resource_get_client(res) != wc) continue;
+             if (!e_comp_wl_input_touch_check(res)) continue;
+             wl_touch_send_up(res, serial, time, 0);
+          }
+     }
+}
index 9f44c27e7cf6aa6f32367e6eb5b82d93ae5558f8..16f18821eb0d49383fe962ddfbbab3c2507b4879 100644 (file)
@@ -57,6 +57,7 @@ EINTERN void e_comp_wl_data_manager_shutdown(E_Comp_Data *cdata);
 EINTERN Eina_Bool e_comp_wl_data_dnd_focus(E_Client *ec);
 EINTERN void e_comp_wl_data_dnd_motion(E_Client *ec, unsigned int time, int x, int y);
 EINTERN void e_comp_wl_data_dnd_drop(E_Client *ec, unsigned int time, uint32_t btn, uint32_t state);
+EINTERN void e_comp_wl_data_dnd_drop_touch(E_Client *ec, unsigned int time, int x, int y, Eina_Bool flag);
 
 # endif
 #endif