Conditionally ignore wayland cursor set events
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 13 Feb 2015 16:46:10 +0000 (10:46 -0600)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 13 Feb 2015 18:47:38 +0000 (13:47 -0500)
Wayland cursor set events should be ignored if the client sending them
doesn't own the surface the pointer is currently in.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
src/bin/e_comp_wl_input.c

index 51f1248515ab3afad8692a4b04412b66438a37bf..f072281f2f7f4aeef59046e5ed56700b68e8335d 100644 (file)
@@ -33,9 +33,21 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
    pid_t pid;
    E_Client *ec;
    uint64_t sid;
+   Eina_Bool got_mouse = EINA_FALSE;
 
    /* get compositor data */
    if (!(cdata = wl_resource_get_user_data(resource))) return;
+   E_CLIENT_FOREACH(e_comp, ec)
+     {
+       if (!ec->comp_data->surface) continue;
+       if (client != wl_resource_get_client(ec->comp_data->surface)) continue;
+       if (ec->mouse.in)
+         {
+           got_mouse = EINA_TRUE;
+           break;
+         }
+     }
+   if (!got_mouse) return;
    if (!surface_resource)
      {
         e_pointer_object_set(e_comp->pointer, NULL, x, y);