devilhorns pushed a commit to branch master.

commit e4924a59866c1439dbfa460a937b01443eb204ff
Author: Chris Michael <[email protected]>
Date:   Fri Aug 16 11:56:17 2013 +0100

    When surface gets destroyed, reset the pointer surface.
    When calling pointer cursor set, if no current surface is focused then
    unmap any existing pointer surface and set to NULL in the structure.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/e_comp_wl.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index af9d776..94c2f49 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1636,10 +1636,14 @@ _e_comp_wl_cb_surface_destroy(struct wl_resource 
*resource)
      return;
 
    pointer = &_e_wl_comp->input->wl.pointer;
-   if (pointer->focus == resource)
+   if ((pointer->focus == resource) || 
+       (pointer->focus_resource == resource))
      {
         wl_pointer_set_focus(pointer, NULL,
                              wl_fixed_from_int(0), wl_fixed_from_int(0));
+
+//        if (_e_wl_comp->input->pointer.surface == ews)
+          _e_wl_comp->input->pointer.surface = NULL;
      }
 
    /* if this surface is mapped, unmap it */
@@ -2257,7 +2261,20 @@ _e_comp_wl_pointer_cb_cursor_set(struct wl_client 
*client, struct wl_resource *r
    if (!input->has_pointer) return;
 
    /* if the input has no current focus, get out */
-   if (!input->wl.seat.pointer->focus) return;
+   if (!input->wl.seat.pointer->focus) 
+     {
+        /* if we have an existing pointer surface, unmap it */
+        if (input->pointer.surface) 
+          {
+             /* call the unmap function */
+             if (input->pointer.surface->unmap)
+               input->pointer.surface->unmap(input->pointer.surface);
+          }
+
+        input->pointer.surface = NULL;
+
+        return;
+     }
 
    if (wl_resource_get_client(input->wl.seat.pointer->focus) != client) return;
    if ((input->wl.seat.pointer->focus_serial - serial) > (UINT32_MAX / 2))

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to