question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Giant, inaccurate mouse cursor on Wayland when using high DPI

See original GitHub issue

Issue Type: Bug

This issue has happened occasionally in the past, but I could just close and reopen Code and it would go away. Now it is happening 99% of the time. I have seen other people mention the same issue in the comments on other issues, but I could not find an issue that was specifically created for it.

The mouse cursor appears to be double its normal size, and the point where a click operation actually occurs is inconsistent and often far off from where one would expect it to be in relation to the cursor. For example, when you click with the cursor between two characters, the caret might jump to the line above and 2 characters to the left of where you clicked - or maybe it’s on the right line and just 1 character off; it’s very inconsistent.

Every once in a while, there are certain areas where the cursor will return to its normal size while I am hovering over them. I’ve noticed this happen occasionally while hovering over the explorer pane or the open tabs bar, but it is rare that it happens at all.

I also noticed that sometimes when I open a second window, the cursor goes to the correct size in both windows, but when I close the second window it reverts to double-size in the original window. Very strange.

This occurs on Arch Linux. I am using Gnome, but I had the exact same issue in a Plasma environment as well. I have tried the latest versions of the open source build, the Microsoft branded release, and Insiders. The problem exists on all of them. It also does not make any difference which cursor theme I am using.

I have multiple monitors and only one of them is high DPI. If I drag the window to a normal DPI monitor, the cursor appears normal. The issue occurs on the high DPI monitor regardless of the amount of scaling (except at 100% of course) - I have tested at 125%, 150%, and 200% and had the same problem on all, so it doesn’t appear to be related to fractional scaling. It is also worth noting that the scaling of the cursor doesn’t seem to match the display scaling - it looks like it’s always double size.

As a workaround, I can fiddle with the --force-device-scale-factor argument and the zoom setting, and get a combination that works OK. But that only takes care of the cursor size, not the accuracy issue, and in that 1% of the time that the cursor renders correctly, it becomes tiny when using the workaround.

These issues do not occur if I don’t start Code with the ozone options, but then of course it uses raster scaling resulting in blurry text.

VS Code version: Code - Insiders 1.62.0-insider (b3318bc0524af3d74034b8bb8a64df0ccf35549a, 2021-11-03T13:18:48.802Z) OS version: Linux x64 5.14.15-arch1-1 Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 7 2700X Eight-Core Processor (16 x 3200)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 0, 0, 1
Memory (System) 31.28GB (15.66GB free)
Process Argv –enable-features=UseOzonePlatform --ozone-platform=wayland --crash-reporter-id 60cb16e3-b07c-417c-9de0-aab704011725
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:19
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
xsrvmycommented, Jan 23, 2022

I have an interesting observation actually: I am using sway, and there is some glitch with my cursor that makes it sometimes use my cursor theme set in KDE (breeze), and sometimes the default black cursor. In chrome, the cursor is regular sized and changes to breeze. In vscode, the cursor stays black and is very big.

1reaction
KucharczykLcommented, Dec 7, 2022

Seems to be fixed on my end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1265799 – hidpi/wayland: mouse cursor too big in gnome ...
It seems there are some duplicate logic in terms of handling HiDPI cursor scaling, which causes the cursor size to be doubled twice....
Read more >
Mouse cursor is tiny on HiDPI screens - Launchpad Bugs
1. Mouse cursor needs to scale with scale factor for the desktop, so that it is in a good size relation with the...
Read more >
1054278 - Mouse Cursor has wrong resolution - Monorail
This seems to load the correct cursor assets, but they are 2x too big visually (and hence still blurry). See https://chromium-review.
Read more >
Chromium mouse pointer size issues when changing between ...
One of them is with Chromium/Chrome. If I launch it in the hidpi screen then its mouse pointer is huge (2x I guess)...
Read more >
Huge mouse cursor in some windows - Unix Stack Exchange
I use i3 as window manager with no desktop manager on debian Stretch (but I only upgraded a couple of days ago, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found