Advertisement
Guest User

Another SDL Mir Motion Event Patch

a guest
May 16th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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,16 @@
  5.  
  6.      AddTouchDevice(motion.device_id);
  7.  
  8. -    switch (motion.action) {
  9. +    int real_action = motion.action & 0xff;
  10. +    if ((real_action == motion_action_pointer_down ||
  11. +         real_action == motion_action_pointer_up)
  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.          case mir_motion_action_down:
  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.      SDL_SetMouseFocus(sdl_window);
  25.  
  26. -    switch (motion.action) {
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement