e_comp_wl: set a pointer object after wl_surface commit is came 27/225927/2
authorjeon <jhyuni.kang@samsung.com>
Tue, 25 Feb 2020 10:09:45 +0000 (19:09 +0900)
committerjeon <jhyuni.kang@samsung.com>
Tue, 25 Feb 2020 12:39:40 +0000 (21:39 +0900)
Change-Id: I4e4ac659bea2b3b9ac0ea401d465ec754a2cc726

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

index bf2e23fb4055cb301796b9fcd17a1e886970445c..b09ca650e0d4774e298806f87d7f47f67da367c7 100644 (file)
@@ -4313,6 +4313,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))
@@ -4381,6 +4382,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 86fc79cada8fa6f1baea0c9a52f9320d7164af8f..4121660616a1e6fca5697515eb243d06c0e0a59d 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 =