Ecore-Sdl: Must set the mouse event's multi struct to 0
authorkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 16 Sep 2011 07:08:53 +0000 (07:08 +0000)
committerkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 16 Sep 2011 07:08:53 +0000 (07:08 +0000)
Otherwise ecore-evas will think that the event is for multi touch
and will ignore the actual values of the structure and will only use
the uninitialized data from the multi struct

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@63431 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_sdl/ecore_sdl.c

index 0694d94..3f28216 100644 (file)
@@ -178,6 +178,12 @@ ecore_sdl_feed_events(void)
              ev->root.x = ev->x;
              ev->root.y = ev->y;
 
+             /* Must set multi touch device to 0 or it will get ignored */
+             ev->multi.device = 0;
+             ev->multi.radius = ev->multi.radius_x = ev->multi.radius_y = 0;
+             ev->multi.pressure = ev->multi.angle = 0;
+             ev->multi.x = ev->multi.y = ev->multi.root.x = ev->multi.root.y = 0;
+
              ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
              break;
           }
@@ -215,6 +221,12 @@ ecore_sdl_feed_events(void)
                   ev->double_click = 0;
                   ev->triple_click = 0;
 
+                  /* Must set multi touch device to 0 or it will get ignored */
+                  ev->multi.device = 0;
+                  ev->multi.radius = ev->multi.radius_x = ev->multi.radius_y = 0;
+                  ev->multi.pressure = ev->multi.angle = 0;
+                  ev->multi.x = ev->multi.y = ev->multi.root.x = ev->multi.root.y = 0;
+
                   ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
                }
              break;
@@ -233,6 +245,12 @@ ecore_sdl_feed_events(void)
              ev->double_click = 0;
              ev->triple_click = 0;
 
+             /* Must set multi touch device to 0 or it will get ignored */
+             ev->multi.device = 0;
+             ev->multi.radius = ev->multi.radius_x = ev->multi.radius_y = 0;
+             ev->multi.pressure = ev->multi.angle = 0;
+             ev->multi.x = ev->multi.y = ev->multi.root.x = ev->multi.root.y = 0;
+
              ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
              break;
           }