e_comp_wl: set a pointer object after wl_surface commit is came 26/225926/2
authorjeon <jhyuni.kang@samsung.com>
Tue, 25 Feb 2020 10:09:45 +0000 (19:09 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Tue, 25 Feb 2020 12:37:53 +0000 (12:37 +0000)
Change-Id: I4e4ac659bea2b3b9ac0ea401d465ec754a2cc726

src/bin/e_comp_wl.c
src/bin/e_comp_wl_input.c

index cab04bc3abe0a5bc8e51413496515e95d38e7356..7ee8ddcd727f7b16c020b038405f5365e4487f22 100644 (file)
@@ -4253,6 +4253,7 @@ E_API Eina_Bool
 e_comp_wl_surface_commit(E_Client *ec)
 {
    Eina_Bool ignored;
+   int x = 0, y = 0;
 
    _e_comp_wl_surface_state_commit(ec, &ec->comp_data->pending);
    if (!e_comp_object_damage_exists(ec->frame))
@@ -4321,6 +4322,20 @@ e_comp_wl_surface_commit(E_Client *ec)
           evas_object_show(ec->comp_data->sub.below_obj);
      }
    ec->ignored = ignored;
+
+   if (ec->is_cursor && ec->visible)
+     {
+        /* ignore cursor changes during resize/move I guess */
+        if (!e_client_action_get())
+          {
+             if (e_comp->pointer)
+               {
+                  x = e_comp->pointer->hot.x;
+                  y = e_comp->pointer->hot.y;
+               }
+             e_pointer_object_set(e_comp->pointer, ec->frame, x, y);
+          }
+     }
    return EINA_TRUE;
 }
 
index f3c494875e791f90c0e1252019c0329af1564b62..14fe3084632290941cb4972b96d0066c62f0a25d 100644 (file)
@@ -127,9 +127,22 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
         ec->is_cursor = EINA_TRUE;
      }
 
+   /* Set a pointer_object after wl_surface commit
+    * if cursor image is changed,
+    * changed information is sent using attach / damage
+    * So in commit, we can know real current cursor image.
+    */
+#if 0
    /* ignore cursor changes during resize/move I guess */
    if (e_client_action_get()) return;
    e_pointer_object_set(e_comp->pointer, ec->frame, x, y);
+#endif
+   if (e_comp->pointer)
+     {
+        e_comp->pointer->hot.x = x;
+        e_comp->pointer->hot.y = y;
+        ec->visible = EINA_TRUE;
+     }
 }
 
 static const struct wl_pointer_interface _e_pointer_interface =