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:
parent
18d59156cc
commit
c0be62b0b4
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue