hmlendea / gfn-electron

Linux Desktop client for Nvidia's GeForce NOW game streaming service
GNU General Public License v3.0
510 stars 62 forks source link

Mouse pointer resets to center of screen when moved too quickly #2

Closed psy-q closed 4 years ago

psy-q commented 4 years ago

Once a game starts, I can only move the pointer reliably if I move it very, very slowly. Otherwise it resets to some center coordinates over and over.

Controller input works, though.

This is with Node 14.7.0 on openSUSE Tumbleweed, Plasma on X11.

ntropy83 commented 4 years ago

Same here, also on Plasma 5 X11, Manjaro KDE

ghost commented 4 years ago

+1 also happens here, POP os 20.04

hmlendea commented 4 years ago

I'm currently investigating this but so far I got no solution

ghost commented 4 years ago

i will see what i can do in my spare time, and hopefully we can fix this!

ntropy83 commented 4 years ago

I played a bit with mouse settings adaptive/flat but no chance. Happens in fullscreen and in the minimized window. Since its affecting the game popup window, there either a value has to be passed or its a GFN thing.

I wasnt able so far to open the game from the browser alone, not with Chrome UA Spoofer.

hmlendea commented 4 years ago

I played a bit with mouse settings adaptive/flat but no chance. Happens in fullscreen and in the minimized window. Since its affecting the game popup window, there either a value has to be passed or its a GFN thing.

I wasnt able so far to open the game from the browser alone, not with Chrome UA Spoofer.

In the browser if you get the "Unsupported platform" message (might be worded differently) even though you're sure you're setting the correct UA, then clear the cookies/cache for that page and try again. It worked for me that way. And the mouse works fine in the browser, it's just here in Electron that it causes problems.

hmlendea commented 4 years ago

An interesting thing that I found is that if I open the devtools programatically in the streaming window, even when I alt tab (so that I get my system cursor back) and try to click anywhere on the dev tools, it just passes through to the stream and I can even hear the Windows error/warning sound. So the GFN stream completely caputres the mouse as long as it is in the same screen area as its own. There might be a conflict between that and how Electron handles captured mouse movement.

My guess is that the reason why the mouse recenters itself is to prevent it from reaching the edge and stopping there when playing first-person games in which you could push your "cursor" towards any edge infinetely. And IDK but in our case I think both GFN and Electron does it when only one should? I'm not sure.

sigmaSd commented 4 years ago

Hi, it works correctly with electron version 5 and 10

hmlendea commented 4 years ago

Hmmm can you elaborate a bit? Which versions exactly? I have the issue on both 5.0.13 and 10.0.0-beta.23

Edit: Oh wow it works actually!

For some reason I still have the issue when running with electron . but when building with electron-builder and running the binary output it works fine!

Thank you very much for your contribution @sigmaSd !!!

hmlendea commented 4 years ago

I've released v1.0.1 with this fix so that people can start using this app with their mouse not just their gamepads However if some people find that they are still affected by it, this issue can be reopened

sigmaSd commented 4 years ago

@hmlendea glad it helped!

ntropy83 commented 4 years ago

Ok I tried deleting the cache for the UA spoofer but that did not work. Maybe it is because I use chromium and not chrome directly.

I tried the new program version and it crashed with a javascript error upon starting the stream. I uncommented this and now its running:

main.js, line 40 window.setPosition( mainWindowPosition[0] + (mainWindowSize[0] - windowSize[0]) / 2, mainWindowPosition[1] + (mainWindowSize[1] - windowSize[1]) / 2);

Mouse is working now too, thank you. :+1:

hmlendea commented 4 years ago

@ntropy83 well this app uses Electron and Electorn uses Chromium so I'm not sure why it's not working. The GoL article however did say that it only works on Chrome.

Regarding the crash yes, I did experience it once also and I'll look into it tomorrow.