input-leap / input-leap

Open-source KVM software
Other
3.71k stars 169 forks source link

Mouse breaks when leaving server's screen #1952

Open weiluntong opened 2 weeks ago

weiluntong commented 2 weeks ago

What happened?

I know there isn't a stable release yet, and I'll admit I'm just using Barrier for now as I wait with bated breath for Input Leap, but I figured I'd put eyes on this issue now.

I've been running my laptop through a couple of 1920*1080 monitors with 60Hz refresh rate, so I haven't noticed this bug until yesterday, in which I actually had to use my laptop's native display which is 2560*1600 with 240Hz refresh rate. I normally connect to a small 2-in-1 that has a 1920*1080 screen with 60Hz refresh rate.

Barrier successfully connects my client (2-in-1) and server(2560*1600 laptop) as expected, but the moment I move my mouse to the client, situated to the right of my server, I've lost all control of my mouse. It won't move, and it doesn't show up on the client. However, one thing I noticed is that my taskbar unhides, and the help tip for the "Show Desktop" button on the far right of the taskbar shows up, suggesting that my mouse probably jumped to the bottom left corner of the client. Another interesting observation is that all keyboard functions seem to work out, and I can click, and it will toggle between minimizing all my open windows to show my desktop, and maximizing the windows I previously had open. I just cannot actually move the mouse. I cannot move my mouse back to the server and use it at all. The only way to regain control of my mouse movements is to stop Barrier on the client. Luckily, as a 2-in-1, it has touch screen hahaha.

In my initial investigation, I noticed that if I plugged my monitors in, but kept the server's native display on, this problem persists. Upon disabling the native display, the problem goes away. My head cannon immediately jumped to blaming the screen resolution, however, changing my screen resolution to 1900*1080 does not fix the issue. Changing the refresh rate has not fixed the issue either. At a loss, I just stopped using it for the day.

I came back today, and decided to try the screen resolution again, and low and behold, 1900*1080 does not work, however, there are quite a few settings that do in fact work. To start, I'd like to list out all the screen resolutions my computer allows me to select from:

I think it's easier because I can now point at this list and say everything starting from 1920*1080 and above does not work. Almost everything below 1920*1080 works, with the exception of 1600*1200. It was here that I noticed that for all of the resolutions above and including 1920*1080 (the ones that don't work) have an interesting behavior in that when I move the mouse, it's not getting to the right edge of the server's screen before it jumps to the bottom right hand corner of the client and gets stuck there.

I can provide logs if need be, I was just not sure what logs would be helpful, so I wanted to give a verbose description of the issue and ask you guys what logs you might be interested in.

Version

v2.4.0

Git commit hash (if applicable)

No response

If applicable, where did you install Input Leap from?

Release page installation executable for windows for both the client and server.

What OSes are you seeing the problem on? (Check all that apply)

Windows

If applicable, are you using Wayland or X11?

No response

What OS versions are you using?

Server: Windows 11 Version 23H2 (OS Build 22631.4037) Client: Windows 11 Version 23H2 (OS Build 22631.4112)

Relevant log output

No response

Any other information

No response

sithlord48 commented 1 week ago

I have two questions;

  1. Do you have any of your displays scaled ?
  2. Have you tried this with input leap on both machines. We have fixed some bugs since our fork and this maybe one of them.
weiluntong commented 1 week ago
  1. Oh wow you're right! I noticed that all the screen resolutions that I mentioned as not working happened to be automatically scaled by Windows! Setting them to 100% seems to make it work
  2. I have installed InputLeap to test if the issue has been fixed. Specifically this one: https://github.com/input-leap/input-leap/actions/runs/10676059232 The issue seems to persist still, when my screen is scaled in anyway, my mouse ends up jumping to the bottom right hand corner of my client and won't move from there.
    • As a side note on that though, that artifact does not come bundled with an input-leapd.exe. I've been running it with barrierd.exe to get the two computers talking. Seems like I'm falling prey to this known issue: #1898. I don't know if the fix for the scaling issue happened to be in the daemon, and I'm not seeing a fixed solution because I'm using the old barrier daemon to get InputLeap talking.
    • Further side note that's probably out of scope of this issue, when stopping the service on input-leap, it does not seem to actually stop the service, as my client is still stuck with a mouse a the bottom right and receiving input from my server after I've verified that the bottom left of the InputLeap window says, "InputLeap is not running". Similarly on the server side, the server persists running despite pressing Stop and verifying the same "InputLeap is not running" on the server.
sithlord48 commented 1 week ago

Thanks for the update. I do think we need to update our windows backend to support scaling properly

sithlord48 commented 5 days ago

Hello i may have a fix for this but i am not able to test it can you test the builds from this action and let me know if that fixes the issue with your scaled windows display https://github.com/input-leap/input-leap/actions/runs/10875806612

When you do test can you test these cases please:

Server Not Scaled with the Client Scaled Server Scaled with the Client Not scaled Server Scaled with the Client Scaled to the same value as the server Server Scaled with the Client Scaled to a different value then the server

weiluntong commented 4 days ago

Hi! Thanks for your work! It looks like this build did not work on my scaled environment.

The steps I took.

Performed on both Client and Server

  1. Open Barrier
  2. Press the "Stop" Button and verify that it changes to "Start"
  3. Open Task Manager
  4. Force quit barrierd.exe
  5. Ensure barrierc.exe and barriers.exe are not running by verifying the processes are not displayed by Task Manager
  6. Open as Administrator: "C:\Program Files\PowerShell\7\pwsh.exe" (I downloaded this from Powershell Core on Github).
  7. Navigate to downloaded binaries directory for input-leap's Windows 2022 artifact retrieved from provided action build.
  8. Run .\input-leapd.exe -f
  9. Navigate to the same directory on a file explorer
  10. Double Click input-leap.exe to run the GUI

Performed on Client

  1. On the GUI, select "Client"
  2. Input "Server IP" information
  3. Click Start

Performed on Server

  1. On the GUI, select "Server"
  2. Select "Configure interactively:
  3. Click Start

Notes

Results

✔ Server Not Scaled with the Client Scaled In retrospect, the Client had always been scaled to 125% in all my tests. Like all my tests prior to your first comment, I stupidly had not noticed that this was already set as such since the first time I used my client.

This test passed. In the test, the the start key registered on the proper machine, meaning the start menu opened on the client or host depending on if the mouse was active on the former or the latter. Mouse movement was unrestricted and can move between client and host, and mouse buttons worked as intended.

✗ Server Scaled with the Client Not scaled This test failed. In the test, once the mouse was moved past the right border of the server, the mouse jumps to the bottom right corner of the client, and I am no longer able to move the mouse. However, mouse buttons presumably work as intended. Primary mouse button will show the desktop. Secondary mouse button on the "Show desktop" button does not do anything, cannot move the mouse to test if it shows a context menu elsewhere. The start key properly registers, opening the start menu on the client.

✗ Server Scaled with the Client Scaled to the same value as the server This test failed. In the test, once the mouse was moved past the right border of the server, the mouse jumps to the bottom right corner of the client, and I am no longer able to move the mouse. However, mouse buttons presumably work as intended. Primary mouse button will show the desktop. Secondary mouse button on the "Show desktop" button does not do anything, cannot move the mouse to test if it shows a context menu elsewhere. The start key properly registers, opening the start menu on the client.

✗ Server Scaled with the Client Scaled to a different value then the server This test failed. In the test, once the mouse was moved past the right border of the server, the mouse jumps to the bottom right corner of the client, and I am no longer able to move the mouse. However, mouse buttons presumably work as intended. Primary mouse button will show the desktop. Secondary mouse button on the "Show desktop" button does not do anything, cannot move the mouse to test if it shows a context menu elsewhere. The start key properly registers, opening the start menu on the client.

Notes

sithlord48 commented 4 days ago

ok thank you for testing , can you right click on input-leapc and input-leaps and try a few of the DPI awareness setting and let me know if any of those fix your issue.

weiluntong commented 4 days ago

I'd love to! I'm afraid I'm not sure what or where the DPI awareness settings are though. Could you elaborate?

sithlord48 commented 4 days ago

I can't really give you more specific info then right click on the input-leaps and input-leapc and look at the properties, one of the options i in that dialog will be about dpi scaling please let me know if any of those work ..

tldr the server is getting the wrong info about the cursor from windows and it doens't know what todo. its been an issue for some time since synergy. hopefully we can squash this for good soon!

sithlord48 commented 2 days ago

I tried something new can you try with this build https://github.com/input-leap/input-leap/actions/runs/10932273754 . thanks