[mutter] core: Unset "pointer emulating" sequence after event processing
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] core: Unset "pointer emulating" sequence after event processing
- Date: Thu, 23 Oct 2014 17:49:12 +0000 (UTC)
commit df384965c32ef3ca1cf6f0a65a074eeb0f40a1dc
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 13 16:20:28 2014 +0200
core: Unset "pointer emulating" sequence after event processing
The set/unset branches of meta_display_update_pointer_emulating_sequence()
have been split and put directly where it makes sense. The pointer emulated
sequence will be updated before processing the CLUTTER_TOUCH_BEGIN, and
after processing the CLUTTER_TOUCH_END, this way the checks on this hold
true during all the sequence lifetime.
https://bugzilla.gnome.org/show_bug.cgi?id=738411
src/core/events.c | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index e0892d8..c20794b 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -151,23 +151,6 @@ sequence_is_pointer_emulated (MetaDisplay *display,
return FALSE;
}
-static void
-meta_display_update_pointer_emulating_sequence (MetaDisplay *display,
- const ClutterEvent *event)
-{
- ClutterEventSequence *sequence;
-
- sequence = clutter_event_get_event_sequence (event);
-
- if (event->type == CLUTTER_TOUCH_BEGIN &&
- !display->pointer_emulating_sequence &&
- sequence_is_pointer_emulated (display, event))
- display->pointer_emulating_sequence = sequence;
- else if (event->type == CLUTTER_TOUCH_END &&
- display->pointer_emulating_sequence == sequence)
- display->pointer_emulating_sequence = NULL;
-}
-
static gboolean
meta_display_handle_event (MetaDisplay *display,
const ClutterEvent *event)
@@ -176,8 +159,15 @@ meta_display_handle_event (MetaDisplay *display,
gboolean bypass_clutter = FALSE;
G_GNUC_UNUSED gboolean bypass_wayland = FALSE;
MetaGestureTracker *tracker;
+ ClutterEventSequence *sequence;
- meta_display_update_pointer_emulating_sequence (display, event);
+ sequence = clutter_event_get_event_sequence (event);
+
+ /* Set the pointer emulating sequence on touch begin, if eligible */
+ if (event->type == CLUTTER_TOUCH_BEGIN &&
+ !display->pointer_emulating_sequence &&
+ sequence_is_pointer_emulated (display, event))
+ display->pointer_emulating_sequence = sequence;
#ifdef HAVE_WAYLAND
MetaWaylandCompositor *compositor = NULL;
@@ -314,6 +304,11 @@ meta_display_handle_event (MetaDisplay *display,
}
#endif
+ /* Unset the pointer emulating sequence after its end event is processed */
+ if (event->type == CLUTTER_TOUCH_END &&
+ display->pointer_emulating_sequence == sequence)
+ display->pointer_emulating_sequence = NULL;
+
display->current_time = CurrentTime;
return bypass_clutter;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]