discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=903b9beaed3b78092a3cbd576a965621e461bd45

commit 903b9beaed3b78092a3cbd576a965621e461bd45
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Feb 6 18:28:11 2015 -0500

    implement wl client cursor support...as clients
    
    <zmike> super funny idea: for client cursors, what if we just implement 
them as an override client with no animations and then hide the canvas cursor 
while the client is visible?
    
    this started as a joke and it worked mostly fine so I improved it and now 
it's shipping and whatdoidowithallthesebugs.jpg
---
 src/bin/e_comp_wl.c       | 12 ++++++++++++
 src/bin/e_comp_wl_input.c | 20 +++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index b50ae14..362224d 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -199,6 +199,18 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas 
EINA_UNUSED, Evas_Object *ob
 
    if (!(ec = data)) return;
    if (ec->cur_mouse_action) return;
+   /* FIXME? this is a hack to just reset the cursor whenever we mouse out. 
not sure if accurate */
+   {
+      Evas_Object *o;
+
+      ecore_evas_cursor_get(e_comp->ee, &o, NULL, NULL, NULL);
+      if (e_comp->pointer->o_ptr != o)
+        {
+           ecore_evas_cursor_unset(e_comp->ee);
+           ecore_evas_object_cursor_set(e_comp->ee, e_comp->pointer->o_ptr,
+             EVAS_LAYER_MAX, e_comp->pointer->hot.x, e_comp->pointer->hot.y);
+        }
+   }
    if (e_object_is_del(E_OBJECT(ec))) return;
 
    if (!ec->comp_data->surface) return;
diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c
index 8c1ec77..57f8dd0 100644
--- a/src/bin/e_comp_wl_input.c
+++ b/src/bin/e_comp_wl_input.c
@@ -27,12 +27,30 @@ _e_comp_wl_input_cb_resource_destroy(struct wl_client 
*client EINA_UNUSED, struc
 }
 
 static void 
-_e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client EINA_UNUSED, 
struct wl_resource *resource EINA_UNUSED, uint32_t serial EINA_UNUSED, struct 
wl_resource *surface_resource EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y 
EINA_UNUSED)
+_e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct 
wl_resource *resource EINA_UNUSED, uint32_t serial EINA_UNUSED, struct 
wl_resource *surface_resource, int32_t x, int32_t y)
 {
    E_Comp_Data *cdata;
+   pid_t pid;
+   E_Client *ec;
+   uint64_t sid;
 
    /* get compositor data */
    if (!(cdata = wl_resource_get_user_data(resource))) return;
+   wl_client_get_credentials(client, &pid, NULL, NULL);
+   sid = e_comp_wl_id_get(wl_resource_get_id(surface_resource), pid);
+   if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, sid)))
+     {
+        ec = e_client_new(NULL, e_pixmap_new(E_PIXMAP_TYPE_WL, sid), 1, 0);
+        ec->layer_block = ec->visible = ec->override = 1;
+        ec->new_client = 0;
+        ec->icccm.title = eina_stringshare_add("noshadow");
+        evas_object_pass_events_set(ec->frame, 1);
+        ec->client.w = ec->client.h = 1;
+     }
+   /* ignore cursor changes during resize/move I guess */
+   if (e_client_action_get()) return;
+   ecore_evas_cursor_unset(e_comp->ee);
+   ecore_evas_object_cursor_set(e_comp->ee, ec->frame, EVAS_LAYER_MAX, x, y);
 }
 
 static const struct wl_pointer_interface _e_pointer_interface = 

-- 


Reply via email to