[OpenSmalltalk/opensmalltalk-vm] 08a01a: Nuke NO_WHEEL_MOUSE macro and alternate g_WM_MOUSE...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] 08a01a: Nuke NO_WHEEL_MOUSE macro and alternate g_WM_MOUSE...

Eliot Miranda-3
 
  Branch: refs/heads/win_generate_mouse_wheel_events
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 08a01a39883fd1cdb39a439f9515dfac03327bd3
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/08a01a39883fd1cdb39a439f9515dfac03327bd3
  Author: Nicolas Cellier <[hidden email]>
  Date:   2019-12-25 (Wed, 25 Dec 2019)

  Changed paths:
    M platforms/win32/vm/sqWin32.h
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Nuke NO_WHEEL_MOUSE macro and alternate g_WM_MOUSEWHEEL message

Those hacks were workaround for lack of support of mouse wheel events in the 90s from M$ OSes.
I'm glad to remind that it's 2020 in a few days, not 1999 anymore, so YAGNI.
We do not support those OS for quite some time, and we should stop bothering.
See https://devblogs.microsoft.com/oldnewthing/20080806-00/?p=21353 for a bit of history


  Commit: ce013398add3c45dd207f403f83f2f69c6037875
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ce013398add3c45dd207f403f83f2f69c6037875
  Author: Nicolas Cellier <[hidden email]>
  Date:   2019-12-25 (Wed, 25 Dec 2019)

  Changed paths:
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Move WM_MOUSEWHEEL message handling as a regular case

Now that we simplified the obsolete logic, there no reason to handle this message differently from others


  Commit: 44ebaf470321f453e966c382536e0289b55b1863
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/44ebaf470321f453e966c382536e0289b55b1863
  Author: Nicolas Cellier <[hidden email]>
  Date:   2019-12-25 (Wed, 25 Dec 2019)

  Changed paths:
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Use GET_X_LPARAM to decode mouse coordinates from WM_MOUSE messages

as recommended here: https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove
`(int)(short) LOWORD(lParam)` is OK, but `LOWORD(lParam)` is not because position can be signed in case of multi-monitor


  Commit: 95e821968134e1030d3d37a22279f22207aa647a
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/95e821968134e1030d3d37a22279f22207aa647a
  Author: Nicolas Cellier <[hidden email]>
  Date:   2019-12-26 (Thu, 26 Dec 2019)

  Changed paths:
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Implement mousewheel events if sendWheelEvents is true (non zero)

Note that this VM parameter is saved in the image and controlled via `Smalltalk sendMouseWheelEvents: true.`

WARNING: unlike Unix and OSX, fill both `buttons` and `modifiers` fields of the event structure.
Unix and OSX only fill `buttons` field with modifiers states! (???) I'd rather change the others.

Note: with my MacBook trackpad, there are many events generated with small scroll deltas (not multiple of 120, but down to 1 unit...)
I don't know why, but it gives sluggish scroll behavior, which does not happen when we emulate via arrow keys.


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/08a01a39883f%5E...95e821968134