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

How to (re)set initial mouse position for OS? #1163

Open
qtis opened this issue Dec 21, 2021 · 4 comments
Open

How to (re)set initial mouse position for OS? #1163

qtis opened this issue Dec 21, 2021 · 4 comments

Comments

@qtis
Copy link

qtis commented Dec 21, 2021

We are experiencing problem that OS cursor seems to be placed in the middle of the screen and affects mouse events when application is running.

I took a screenshot from recording (before chrome starts, which is in next second) and you can see mouse cursor in the middle of the screen.

image

Is there a way to control or remove OS mouse cursor as chromedriver (via webdriver) seems to emulate it's own cursor, not via OS so you end up with two cursors :|

@qtis qtis changed the title (re) Set initial mouse position for OS (re)set initial mouse position for OS Dec 21, 2021
@qtis qtis changed the title (re)set initial mouse position for OS How to (re)set initial mouse position for OS? Dec 21, 2021
@vania-pooh
Copy link
Member

@qtis you can add xdotool command call to browser image entrypoint.sh to fix this. Currently this is not supported out of the box.

@qtis
Copy link
Author

qtis commented Dec 22, 2021

@qtis you can add xdotool command call to browser image entrypoint.sh to fix this. Currently this is not supported out of the box.

That helped. Now I've built custom image based on chrome_vnc with xdotool installed via Docker build
and extra line in entrypoint.sh before chromedriver start:

echo Moving mouse to position 0 0
DISPLAY="$DISPLAY" /usr/bin/xdotool mousemove 0 0

You can see it is in the corner now:

image

Request
Would be great if you could also add it to official images as same issue might be causing issues for other as well.
Otherwise I guess I'd have to rebuild custom images on each release ¯_(ツ)_/¯

@gdonati78
Copy link

We experience a cursor displayed when we run Chrome with mobile emulation enabled (experimental option mobileEmulation). No cursor would be expected, none is shown when using other hubs with the same settings. Is it related to this same issue?

@vania-pooh
Copy link
Member

@gdonati78 Chrome in mobile emulation is the same as Chrome desktop. So yes, that's related.

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

3 participants