summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-01-21 12:52:21 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-02-02 13:35:38 -0500
commitc0be62b0b46238256e8c0c8b1192400cab2472df (patch)
tree6dbffac41a49a756867a801f278323ed47b5f107
parent18d59156cc9dd4d8b469190e0162e533bdfb44c5 (diff)
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
-rw-r--r--src/bin/e_comp_wl.c8
-rw-r--r--src/bin/e_comp_wl.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index b0d29487b..425b74a2a 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
3099 break; 3099 break;
3100 } 3100 }
3101 3101
3102 if (state == WL_POINTER_BUTTON_STATE_PRESSED)
3103 e_comp_wl->ptr.button_mask |= 1 << button_id;
3104 else
3105 {
3106 /* reject release events if button is not pressed */
3107 if (!(e_comp_wl->ptr.button_mask & (1 << button_id))) return EINA_FALSE;
3108 e_comp_wl->ptr.button_mask &= ~(1 << button_id);
3109 }
3102 e_comp_wl->ptr.button = btn; 3110 e_comp_wl->ptr.button = btn;
3103 3111
3104 if (!ec->comp_data->surface) return EINA_FALSE; 3112 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 d280eb387..48c085fa6 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -167,6 +167,7 @@ struct _E_Comp_Wl_Data
167 wl_fixed_t x, y; 167 wl_fixed_t x, y;
168 wl_fixed_t grab_x, grab_y; 168 wl_fixed_t grab_x, grab_y;
169 uint32_t button; 169 uint32_t button;
170 uint32_t button_mask;
170 E_Client *ec; 171 E_Client *ec;
171 Eina_Bool enabled : 1; 172 Eina_Bool enabled : 1;
172 } ptr; 173 } ptr;