Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse cursor is shifted from cursor pointer until I scroll to the far right and get out of the window #993

Closed
Meow-ops opened this issue Jan 9, 2018 · 13 comments

Comments

@Meow-ops
Copy link

Meow-ops commented Jan 9, 2018

Using the vnc_lite.html as a template.
The first time the mouse enters the vnc div noVNC_canvas the server mouse pointer is shifted from the real one of a strict offset.
If I scroll the horizontal bar to the far right side of the canva, get the mouse pointer out of the screen and reenters it, it settles the server cursor at the exact same position as my local mouse pointer. I can scroll back to the far left and it stays correct.
Is there a way to correct the shift issue right at the first entering of the canva?
Here is the way I create the canva:

            <div id="noVNC_left_dummy_elem"></div>
            <div id="noVNC_status">Loading</div>
            <div id="noVNC_buttons">
                <input type=button value="Send CtrlAltDel" id="sendCtrlAltDelButton" class="noVNC_shown">
                <span id="noVNC_power_buttons" class="noVNC_hidden">
                    <input type=button value="Shutdown" id="machineShutdownButton">
                    <input type=button value="Reboot" id="machineRebootButton">
                    <input type=button value="Reset" id="machineResetButton">
                </span>
            </div>
        </div>
        <div id="noVNC_canvas">
        </div>

and the rfb code:
rfb = new RFB(document.getElementById('noVNC_canvas'), url)

@Meow-ops
Copy link
Author

Meow-ops commented Jan 9, 2018

I have tried using the complete vnc_lite.html file and the shifting offset is still present.

Note that I have disable mouse acceleration on the server. The offset is also present when I use gvncviewer. Even when "-usbdevice tablet" option is used when starting qemu

@samhed
Copy link
Member

samhed commented Jan 9, 2018

So if the offset is also present when you are using a different VNC viewer, doesn't that indicate that your issue is serverside?

@samhed samhed added the ui/lite label Jan 9, 2018
@Meow-ops
Copy link
Author

Meow-ops commented Jan 10, 2018

Sorry I didn't try this through the first time : I tried it on gvncviewer but the mouse cursor cannot escape the server screen so the problem does not really happen. I tried it on Remmina as well and once the mouse enhancement parameter is off, it works quite fine.

What I find odd with noVNC is that putting the scrollbar to the far right and exiting, reentering the vnc screen fixes the issue.

@Meow-ops
Copy link
Author

I tried on http://novnc.com/noVNC/vnc.html as well. I have the same issue, at launch, there is an offset, if I put my mouse out of the screen (this time the bottom works), it resets the pointer to the exact same prosition

@samhed
Copy link
Member

samhed commented Jan 10, 2018

Could you make a screencast or a screenshot that shows this issue?

@Meow-ops
Copy link
Author

custom_vnc_html
novnc_html

@CendioOssman
Copy link
Member

This simply looks like you haven't got proper "tablet mode" working in your virtual machine. You'll never get reliable cursor tracking without that. Both gifs show the same issue, only that the first one seems to have hidden the local cursor.

@Meow-ops
Copy link
Author

Okay, so it seems it comes from the qemu version I am using. I am closing the issue, if I manage to solve it through qemu I will let you know.
Thanks for your help,

@cristian-eriomenco
Copy link

@sarcarx Can you please share with the solution. I'm having same issue

@Meow-ops
Copy link
Author

Meow-ops commented Jun 2, 2018

Yes, it was because I was loading the virtual machine with a snapshot that was not started with the right options.
I added usbdevice usb-tablet in the qemu parameters and restarted the whole virtual machine, and it worked. I did not have to disable mouse acceleration by the way.

@Incrediblestorm
Copy link

WOW, I just finished building an Ubuntu/Xen server for the first time, and I had been getting a little annoyed about this issue. I actually thought that maybe it was just part of the functionality.

You guys can't imagine how grateful I am for this thread. It was usbdevice=['tablet'] in my case, but yes, the problem is completely fixed.

@jkleckner
Copy link

You guys can't imagine how grateful I am for this thread. It was usbdevice=['tablet'] in my case, but yes, the problem is completely fixed.

Totally agree. A long term annoying situation fixed.

@pierre42100
Copy link

On Libvirt, the problem can be fixed by adding a input device to the domain:

<devices>
...
  <input type='tablet' bus='virtio'/>
...
</devices>

Ref: https://libvirt.org/formatdomain.html#input-devices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants