fix SDL mouse events processing

This fixes SDL mouse events processing:
- GetRelativeMouseState() always returns the last position, so when the
  polling loop gets several mouse events in one go, we would send
  useless 'no move' events, let's avoid that.
- So as to make sure we don't miss any mouse click / double click, we
  should not use GetRelativeMouseState() to get the button state, but
  rather keep records of the button state ourselves (I've requested SDL
  developers to provide it directly in the event in SDL 1.3).
- bev->state doesn't contain the button state but whether the event is a press
  or a release. Use bev->button instead.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
1 file changed
tree: 41b6d19a6ef89888b76233319bd891d01aa9ffc6
  1. audio/
  2. darwin-user/
  3. fpu/
  4. hw/
  5. i386-dm/
  6. i386-stubdom/
  7. keymaps/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-mips/
  17. target-ppc/
  18. target-sh4/
  19. target-sparc/
  20. tcg/
  21. tests/
  22. .gitignore
  23. a.out.h
  24. aes.c
  25. aes.h
  26. alpha-dis.c
  27. alpha.ld
  28. arm-dis.c
  29. arm-semi.c
  30. arm.ld
  31. block-bochs.c
  32. block-cloop.c
  33. block-cow.c
  34. block-dmg.c
  35. block-parallels.c
  36. block-qcow.c
  37. block-qcow2.c
  38. block-raw-posix.c
  39. block-raw-win32.c
  40. block-vbd.c
  41. block-vmdk.c
  42. block-vpc.c
  43. block-vvfat.c
  44. block.c
  45. block.h
  46. block_int.h
  47. bswap.h
  48. Changelog
  49. check_ops.sh
  50. cocoa.m
  51. configure
  52. console.c
  53. console.h
  54. COPYING
  55. COPYING.LIB
  56. cpu-all.h
  57. cpu-defs.h
  58. cpu-exec.c
  59. cris-dis.c
  60. curses.c
  61. curses_keys.h
  62. cutils.c
  63. d3des.c
  64. d3des.h
  65. dis-asm.h
  66. disas.c
  67. disas.h
  68. dyngen-exec.h
  69. dyngen.c
  70. elf.h
  71. elf_ops.h
  72. exec-all.h
  73. exec.c
  74. gdbstub.c
  75. gdbstub.h
  76. host-utils.c
  77. host-utils.h
  78. hostregs_helper.h
  79. hpet.h
  80. hppa-dis.c
  81. hppa.ld
  82. i386-dis.c
  83. i386.ld
  84. ia64.ld
  85. keymaps.c
  86. kqemu.c
  87. kqemu.h
  88. LICENSE
  89. loader.c
  90. m68k-dis.c
  91. m68k-semi.c
  92. m68k.ld
  93. MAINTAINERS
  94. Makefile
  95. Makefile.target
  96. mips-dis.c
  97. mips.ld
  98. mipsel.ld
  99. monitor.c
  100. net.h
  101. osdep.c
  102. osdep.h
  103. ppc-dis.c
  104. ppc.ld
  105. qemu-binfmt-conf.sh
  106. qemu-char.h
  107. qemu-common.h
  108. qemu-doc.texi
  109. qemu-img.c
  110. qemu-img.texi
  111. qemu-tech.texi
  112. qemu-timer.h
  113. qemu-xen.h
  114. qemu_socket.h
  115. readline.c
  116. README
  117. s390-dis.c
  118. s390.ld
  119. sdl.c
  120. sdl_keysym.h
  121. sh4-dis.c
  122. softmmu-semi.h
  123. softmmu_exec.h
  124. softmmu_header.h
  125. softmmu_template.h
  126. sparc-dis.c
  127. sparc.ld
  128. sparc64.ld
  129. sysemu.h
  130. tap-win32.c
  131. tapdisk-ioemu.c
  132. texi2pod.pl
  133. thunk.c
  134. thunk.h
  135. TODO
  136. translate-all.c
  137. uboot_image.h
  138. usb-linux.c
  139. VERSION
  140. vga-patch-from-xen-unstable-17737:c93a913c221f
  141. vgafont.h
  142. vl.c
  143. vnc.c
  144. vnc_keysym.h
  145. vnchextile.h
  146. wip-make-vl-compile
  147. x86_64.ld
  148. x_keymap.c
  149. xen-config-host.h
  150. xen-config-host.mak
  151. xen-config.mak
  152. xen-hooks.mak
  153. xen-setup
  154. xen-vl-extra.c
  155. xenfbfront.c
  156. xenstore.c