discomfitor pushed a commit to branch enlightenment-0.20.

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

commit c0be62b0b46238256e8c0c8b1192400cab2472df
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Jan 21 12:52:21 2016 -0500

    track wayland client mouse button states as a full button mask
    
    sending a button release event to a surface which has not previously
    received a button press yields strange results
---
 src/bin/e_comp_wl.c | 8 ++++++++
 src/bin/e_comp_wl.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index b0d2948..425b74a 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -3099,6 +3099,14 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, 
uint32_t timestamp, uint32_t bu
         break;
      }
 
+   if (state == WL_POINTER_BUTTON_STATE_PRESSED)
+     e_comp_wl->ptr.button_mask |= 1 << button_id;
+   else
+     {
+        /* reject release events if button is not pressed */
+        if (!(e_comp_wl->ptr.button_mask & (1 << button_id))) return 
EINA_FALSE;
+        e_comp_wl->ptr.button_mask &= ~(1 << button_id);
+     }
    e_comp_wl->ptr.button = btn;
 
    if (!ec->comp_data->surface) return EINA_FALSE;
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index d280eb3..48c085f 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -167,6 +167,7 @@ struct _E_Comp_Wl_Data
         wl_fixed_t x, y;
         wl_fixed_t grab_x, grab_y;
         uint32_t button;
+        uint32_t button_mask;
         E_Client *ec;
         Eina_Bool enabled : 1;
      } ptr;

-- 


Reply via email to