wslg icon indicating copy to clipboard operation
wslg copied to clipboard

Mouse cursor offset is misaligned in Wayland applications

Open v-chernyshev opened this issue 3 years ago • 7 comments

Windows build number:

Microsoft Windows [Version 10.0.19043.2364]

Your Distribution version:

Ubuntu 22.10

Your WSL versions:

WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19043.2364

Steps to reproduce:

Hello, I've recently started using WSLg on Windows 10 and have noticed a peculiar problem with all Wayland-enabled applications (epiphany, for instance). I don't know what the proper technical terms are, but, essentially, the visual position of the mouse cursor does not match the actual click point. The click is registered approximately 2-3 millimetres to the left of the cursor. X11 applications do not exhibit this problem, but are very blurry.

WSL logs:

No response

WSL dumps:

No response

Expected behavior:

I expect the cursor and click positions to match. For instance, in this example:

photo_5850360307946470034_y

The caret should be placed in front of "v" rather than "a".

Actual behavior:

The cursor offset is off.

v-chernyshev avatar Dec 23 '22 19:12 v-chernyshev

@v-chernyshev, thanks for reporting the issue. can you try weston-clickdot, which is one of Wayland demo applications, from weston package (sudo apt install weston, on Ubuntu), and do you see mouse is still offset? thanks!

hideyukn88 avatar Dec 28 '22 18:12 hideyukn88

@v-chernyshev, now I'm able to reproduce the issue you have been seeing, does your monitor have more than 100% scaling (HI-DPI) ? thanks!

hideyukn88 avatar Dec 28 '22 19:12 hideyukn88

Hi @hideyukn88, thank you for investigating the report! I indeed tried WSLg on a HI-DPI system. A 15" Lenovo ThinkPad X1 Extreme Gen 3 laptop to be precise, with 250% scaling.

v-chernyshev avatar Dec 28 '22 19:12 v-chernyshev

Have you tried this .wslgconfig yet? I just installed epiphany and everything seems to line up with the mouse. How websites look, on the other hand... now that's an entirely different matter.

[system-distro-env]
WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100

For me both of these variables needed to be setup for it to work, however.

Edit: Disclaimer: I'm running Debian 11 (bullseye)

patricknelson avatar Oct 12 '23 02:10 patricknelson

This issue happens when there are multiple screen, using extend configure, if use the duplicate display configure, it works correctly. while if use extend conifgure, it will appear.

Confirmed on both jetbrains idea and cursor and windsurf.

Might related to https://github.com/microsoft/wslg/issues/1116 also

May also related to this also: https://github.com/microsoft/wslg/issues/1233

xqliu avatar May 18 '25 04:05 xqliu

Hello, Has anyone found a solution or workaround for this? We would really like to stop using X410, but it’s not possible for us to work without multiple screens in Extend mode.

ninehd avatar Oct 27 '25 09:10 ninehd

Same problem here. It is really annoying as it makes some applications unusable. A few times I've been lucky using the Win+Shift+Up shortcut to maximize the window and it gets fixed, but sometimes the application won't allow me to maximize so I'm stuck

TrustMeIm0xDolphin avatar Nov 03 '25 22:11 TrustMeIm0xDolphin