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
This commit is contained in:
Mike Blumenkrantz 2016-01-21 12:52:21 -05:00
parent d09b1030b8
commit d689ab5e75
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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;