1
0
Fork 0

gesture-tracker: Never reject sequences in Wayland sessions

In constrast to x11, Wayland has sane handling for touch events and
allows the compositor to handle a touch event while the clients are
already seeing it. This means we don't need the REJECTED state on
Wayland, since we can also grab sequences after the client has seen
them.

So disallow moving sequences to the REJECTED state on Wayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2508>
This commit is contained in:
Jonas Dreßler 2022-05-09 13:17:46 +02:00 committed by Marge Bot
parent fc1b4ae149
commit 28982ade94

View file

@ -227,6 +227,24 @@ static gboolean
state_is_applicable (MetaSequenceState prev_state,
MetaSequenceState state)
{
if (meta_is_wayland_compositor ())
{
/* Never reject sequences on Wayland, on Wayland we deliver touch events
* to clients right away and can cancel them later when accepting a
* sequence.
*/
if (state == META_SEQUENCE_REJECTED)
return FALSE;
}
else
{
/* Sequences must be accepted/denied before PENDING_END */
if (prev_state == META_SEQUENCE_NONE &&
state == META_SEQUENCE_PENDING_END)
return FALSE;
}
/* PENDING_END state is final */
if (prev_state == META_SEQUENCE_PENDING_END)
return FALSE;
@ -235,11 +253,6 @@ state_is_applicable (MetaSequenceState prev_state,
if (state == META_SEQUENCE_NONE)
return FALSE;
/* Sequences must be accepted/denied before PENDING_END */
if (prev_state == META_SEQUENCE_NONE &&
state == META_SEQUENCE_PENDING_END)
return FALSE;
/* Make sequences stick to their accepted/denied state */
if (state != META_SEQUENCE_PENDING_END &&
prev_state != META_SEQUENCE_NONE)