[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/Cog
  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.


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

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

  Log Message:
  -----------
  Deliver mouse wheel events only once they reach a threshold

On some devices (example Mac trackpad), many events are generated with small deltas.
This is overwhelming the EventSensor loop at image side to the detriment of user experience.
Workaround by letting the VM accumulate those deltas until they reach a threshold before delivering.

In case of high delta values, we generate a single value.
It's up to image side to handle those values
(until now, Squeak 5.3 just ignored them, VM is not to be blamed for that).

Note: 2 values are hardcoded for now
- the timeout for stopping accumulation (500ms)
- the threshold for delivering the event to the image.

The threshold could have been WHEEL_DELTA, but it gives bad sensitivity on my own device, so use only a fraction of that in the hope that it fits other devices too.
Please report if those tuning are inappropriate. We may add parameters in the future if necessary...


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

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

  Log Message:
  -----------
  Merge pull request #461 from OpenSmalltalk/win_generate_mouse_wheel_events

Win generate mouse wheel events


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/f70cf5f34041...48af339d0527