macintosh.js icon indicating copy to clipboard operation
macintosh.js copied to clipboard

Mouse cursor jumps around rapidly when moved

Open MQDuck opened this issue 4 years ago • 13 comments

Whenever the mouse cursor is moved, it jumps around rapidly almost as if it's trying to exist in the superposition of two or sometimes three different cursor locations, each of which scale differently with mouse movement. It's difficult to describe, so I made a video: https://youtu.be/wr_hh1mULHk

MQDuck avatar Jul 29 '20 01:07 MQDuck

For me, it's happening when drawing in Photoshop. Great app btw. Loving it!!!!!

keyvez avatar Jul 29 '20 06:07 keyvez

This happens for me as well on a MacBook Pro running the latest MacOS 11 public beta (11.0 Beta (20A4300b)).

aaron-trout avatar Jul 29 '20 09:07 aaron-trout

Same issue on a Windows 10 host. Seems like some kind of factor is occasionally applied to the axis depending on how big X and Y are.

AyrA avatar Jul 29 '20 15:07 AyrA

same issue

OptimisticMonkey avatar Jul 29 '20 18:07 OptimisticMonkey

Same problem. It seems like moving very slowly makes it happen slightly less.

doomchild avatar Jul 29 '20 18:07 doomchild

Same problem here as well

win9x-se avatar Jul 29 '20 21:07 win9x-se

Running version 1.04 on Ubuntu 20.04 and MATE. I'm seeing two cursors. They converge at the top left hand side of the window and they diverge more and more as the cursor moves further down and to the right.

johnblommers avatar Jul 29 '20 21:07 johnblommers

@johnblommers That is what I am seeing on Windows 10 so this sounds like a cross-platform issue.

When moving the cursor it rapidly moves between three points. The location that matches the real mouse location, and then two spots 2x and 3x the distance from the top left corner. When you stop moving the mouse the cursor may settle into any of these locations.

The-MAZZTer avatar Jul 29 '20 23:07 The-MAZZTer

I have a fix. In %LOCALAPPDATA%\macintosh\app-1.0.2\resources\app\src\renderer\input.js line 46-47 change

    mouseMoveX += inputEvent.dx;
    mouseMoveY += inputEvent.dy;

to

    mouseMoveX = inputEvent.dx;
    mouseMoveY = inputEvent.dy;

It looks like the problem is the JS was taking mousemove events and using the absolute mouse position as a delta (hence the names dx and dy). The developer may have been confused by the mousemove event data variable names "offsetX/Y" which refers to the location of the mouse cursor in a DOM element (eg location offset to the element location) NOT offset from previous mouse location.

The-MAZZTer avatar Jul 29 '20 23:07 The-MAZZTer

Excellent. On Linux the offending file is at:

/usr/lib/macintosh.js/resources/app/src/renderer/input.js

The same edit as cited above fixes the problem. At lines 46-47:

    mouseMoveX = inputEvent.dx;
    mouseMoveY = inputEvent.dy;

johnblommers avatar Jul 30 '20 00:07 johnblommers

Working great, on macOS the offending file is at:

/Applications/macintosh.js.app/Contents/Resources/app/src/renderer/input.js

linguanostra avatar Jul 30 '20 02:07 linguanostra

Submitted change via PR #30

jonathanpotts avatar Jul 30 '20 02:07 jonathanpotts

@The-MAZZTer your fix worked for me experiencing the same issue on Windows 10 (2004).

maxpereira avatar Jul 30 '20 05:07 maxpereira