display: Add meta_display_is_pointer_emulating_sequence()

This function tells the obvious on X11, and implements a similar mechanism
on wayland to determine the "pointer emulating" sequence, or one to stick
with when implementing single-touch behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
This commit is contained in:
Carlos Garnacho
2014-07-22 01:14:14 +02:00
parent 177ec27cca
commit 41fdc4ac2e
4 changed files with 82 additions and 0 deletions

View File

@ -3239,3 +3239,23 @@ meta_display_request_restart (MetaDisplay *display)
return result;
}
/**
* meta_display_is_pointer_emulating_sequence:
* @display: the display
* @sequence: (nullable): a #ClutterEventSequence
*
* Tells whether the event sequence is the used for pointer emulation
* and single-touch interaction.
*
* Returns: #TRUE if the sequence emulates pointer behavior
**/
gboolean
meta_display_is_pointer_emulating_sequence (MetaDisplay *display,
ClutterEventSequence *sequence)
{
if (!sequence)
return FALSE;
return display->pointer_emulating_sequence == sequence;
}