View difference between Paste ID: fy97wgEJ and PB7FTvkk
SHOW: | | - or go back to the newest paste.
1
diff -r 8af7a4af8fe0 src/video/mir/SDL_mirevents.c
2
--- a/src/video/mir/SDL_mirevents.c	Sun May 11 15:59:22 2014 +0200
3
+++ b/src/video/mir/SDL_mirevents.c	Fri May 16 11:21:39 2014 +0200
4-
@@ -164,7 +164,13 @@
4+
@@ -164,7 +164,16 @@
5
 
6
     AddTouchDevice(motion.device_id);
7
 
8
-    switch (motion.action) {
9-
+    int real_action = mir_motion_action_move;
9+
+    int real_action = motion.action & 0xff;
10-
+    if (motion.action >> 8 == cord_index)
10+
+    if ((real_action == motion_action_pointer_down ||
11
+         real_action == motion_action_pointer_up)
12-
+        real_action = motion.action & 0xff;
12+
+         && (motion.action >> 8 != cord_index))
13
+    {
14
+        return;
15
+        // real_action = mir_motion_action_move; // or hover? should not be necessary since that information is already provided in separate events
16
+    }
17
+
18
+    switch (real_action) {
19-
@@ -187,7 +193,13 @@
19+
20
         case mir_motion_action_pointer_down:
21
             HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure);
22
@@ -187,7 +196,16 @@
23
 {
24-
+    int real_action = mir_motion_action_move;
24+
25-
+    if (motion.action >> 8 == cord_index)
25+
26
-    switch (motion.action) {
27-
+        real_action = motion.action & 0xff;
27+
+    int real_action = motion.action & 0xff;
28
+    if ((real_action == motion_action_pointer_down ||
29
+         real_action == motion_action_pointer_up)
30
+         && (motion.action >> 8 != cord_index))
31
+    {
32
+        return;
33
+        // real_action = mir_motion_action_move; // or hover? should not be necessary since that information is already provided in separate events
34
+    }
35
+
36
+    switch (real_action) {
37
         case mir_motion_action_down:
38
         case mir_motion_action_pointer_down:
39
             HandleMouseButton(sdl_window, SDL_PRESSED, motion.button_state);