wslg icon indicating copy to clipboard operation
wslg copied to clipboard

Mouse pointer is scaled as of display config is scaled

Open noomz opened this issue 4 years ago • 21 comments

Environment

Windows build number:  10.0.21364.0
Your Distribution version:  Ubuntu 20.04.2 LTS on Windows 10 x86_64
Your WSLg version: 1.0.17.1

Steps to reproduce

  1. Set display Scale and layout option to more than 100% eg: 250%.
  2. Install and run gnome-terminal

WSL logs:

  • versions.txt
     WSLg ( x86_64 ): 1.0.17+3.Branch.master.Sha.a526dfd5ad03d126bb2d8c528f6c3563e86a40da
     Mariner: VERSION="1.0.20210224"
     FreeRDP: e4a2fc2053bd8c5f99455fcd08ffee7e5591567a
     weston: fd961f5cd116c9358d82ce94d139c1578e21bd00
     pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5
     mesa:
    

Expected behavior

The pointer should have a normal size compared to running apps. Text selection should be selected only under that cursor.

Actual behavior

It's scaled to a bigger size and does wrong text selection.

Demo Video:

https://user-images.githubusercontent.com/24957/115858942-bf180880-a459-11eb-83e1-1a0e587fbcab.mp4

Display Config:

image

noomz avatar Apr 23 '21 10:04 noomz

@noomz , please refer https://github.com/microsoft/wslg/issues/23 and enable fractional scaling support and check if it solves.

hideyukn88 avatar Apr 23 '21 14:04 hideyukn88

@hideyukn88 Nope. It doesn't work. It's the UI interface that changes, the mouse pointer size is still big and fail on selection.

noomz avatar Apr 24 '21 05:04 noomz

@hideyukn88 It can't be solved, and the mouse will be enlarged whether it is on 200% desktop or 100% desktop. I use archlinux. The system I used before wslg did not increase the size of the application mouse after upgrading to wslg, but my newly installed system showed that the mouse became larger.

When the mouse is placed on the border, it is not enlarged, only when it is placed in the menu or text area.

ati46 avatar Apr 30 '21 08:04 ati46

@ati46 , I am not able to reproduce that enlarged cursor in your video with Ubuntu 20.04 LTS with gnome-terminal. For reference, would you please check if your gnome-terminal is running in X11 backend or Wayland mode ? (For me I can't repro in both mode though) Normally by default, it runs on wayland mode (as WSLg runs on wayland compositor), but can switch to X11 backend by "export GDK_BACKEND=x11".

Also, the regarding to selection, the cursor's hotspot is upper left corner of cursor bounding box, not center of cursor image, please check if selection is made at hotspot? Thanks!

hideyukn88 avatar May 02 '21 02:05 hideyukn88

After restart yesterday, the mouse pointer is not large, and, gnome-terminal is not scaled too (previously scaled). No further configuration on WSLg. And the selection hotspot is at the center of the characters, not the left corner.

https://user-images.githubusercontent.com/24957/116803732-768cd900-ab44-11eb-9f19-a0d83e3440f8.mp4

noomz avatar May 02 '21 05:05 noomz

After last windows 10 next updated today. The cursor is still scaled.

noomz avatar Jun 09 '21 05:06 noomz

Windows 11 cursor it too big. But this solution can solve the issue as temporary solution. sudo apt-get update sudo apt-get install dconf-tools dconf-editor navigate to org.gnome.desktop.interface and change cursor-size from 24 to 12.

image

rizhenkov avatar Nov 05 '21 22:11 rizhenkov

I have the same issue here on Windows11/WSLg with a 4k screen / 200% scaling. The pointer is too big. I changed the pointer size using gsettings, with works for the standard cursor, but not for custom cursors which are created by some application (e.g., gnumeric).

parrenin avatar Jan 13 '22 17:01 parrenin

Windows 11 cursor it too big. But this solution can solve the issue as temporary solution. sudo apt-get update sudo apt-get install dconf-tools dconf-editor navigate to org.gnome.desktop.interface and change cursor-size from 24 to 12.

image

I face this error E: Unable to locate package dconf-tools when I try sudo apt-get install dconf-tools can you please help me with this

MumenAlmadaineh avatar Apr 17 '22 04:04 MumenAlmadaineh

Windows 11 cursor it too big. But this solution can solve the issue as temporary solution. sudo apt-get update sudo apt-get install dconf-tools dconf-editor navigate to org.gnome.desktop.interface and change cursor-size from 24 to 12. image

I face this error E: Unable to locate package dconf-tools when I try sudo apt-get install dconf-tools can you please help me with this

Just install dconf-editor is enough.

Reflyer823 avatar Jun 22 '22 08:06 Reflyer823

I have the same issue (in intellijidea). The cursor is correct on the menubar, but huge when over the text area. It's probably related to some old setting/configuration:

image

bluelu avatar Sep 13 '22 08:09 bluelu

Try this > Size - integer value echo "Xcursor.size: Size" > ~/.Xresources xrdb -load ~/.Xresources

Memoraike avatar Oct 21 '22 04:10 Memoraike

If you're using wayland, this might work for you:

gsettings set org.gnome.desktop.interface cursor-size 12

This sets the size to 12 which looks to me about the same size as that of the native cursor. You can change the size to whatever you want.

To view the current value: gsettings get org.gnome.desktop.interface cursor-size

georgio avatar Sep 27 '23 21:09 georgio

The gsettings workaround is unacceptable if you are using waypipe to access a remote machine. Microsoft needs to fix this bug that has been reported more than two years ago. They haven't even acknowledged it.

psarraf avatar Dec 03 '23 03:12 psarraf

I'm running into the same issue. The fractional scaling link didn't work. It affected the PyCharm window and its content, but not the mouse cursor. The gsettings command did nothing for me either and I'm using Wayland.

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.19045.4529

My distro is Ubuntu-24.04 as of about 2024-06-18

FWIW, I don't have this problem with my Ubuntu-20.04 WSL2 distro on the same machine

Hammit avatar Jun 20 '24 05:06 Hammit

echo "Xcursor.size: Size" > ~/.Xresources xrdb -load ~/.Xresources

The good news, this works for me. The bad news, I need to do this every time wsl restarts

Placing this inside .bashrc kind of fixes it. But only if I launch an interactive terminal first and then my gui app But not when launching an application via the windows side shortcut

Where can I put the xrdb -load ~/.Xresources so that it gets picked up when starting an application via its shortcut ?

I have tried creating ~/.xinitrc, /etc/X11/xinit/xinitrc and placing it there, but that did not help

KoenDierckx avatar Jul 24 '24 05:07 KoenDierckx

Same issue here:

Ubuntu 22.0.4 OK Ubuntu 24.0.4 big mouse pointer

WSL-Version: 2.3.14.0 Kernelversion: 6.6.36.3-1 WSLg-Version: 1.0.64 MSRDC-Version: 1.2.5326 Direct3D-Version: 1.611.1-81528511 DXCore-Version: 10.0.26100.1-240331-1435.ge-release Windows-Version: 10.0.22621.4037

jruhe-adesso avatar Aug 27 '24 12:08 jruhe-adesso

I put this in~/.profile which seems to work pretty well:

# load any xresrouce settings on login:
if [ -e "$HOME/.Xresources" ]; then
    # echo "Not loading xresource file"
    xrdb -load "$HOME/.Xresources"
fi

echo "Xcursor.size: Size" > ~/.Xresources xrdb -load ~/.Xresources

The good news, this works for me. The bad news, I need to do this every time wsl restarts

Placing this inside .bashrc kind of fixes it. But only if I launch an interactive terminal first and then my gui app But not when launching an application via the windows side shortcut

Where can I put the xrdb -load ~/.Xresources so that it gets picked up when starting an application via its shortcut ?

I have tried creating ~/.xinitrc, /etc/X11/xinit/xinitrc and placing it there, but that did not help

FredSRichardson avatar Nov 22 '24 20:11 FredSRichardson

My particular problem was that PyCharm cursor was enlarged when using the app. I found a solution which I'm referencing here for the benefit of others...

JetBrains IDE Cursor Fix

Put this in your .profile or execute in shell before loading the IDE

export XCURSOR_SIZE=14

Hammit avatar May 07 '25 06:05 Hammit

export XCURSOR_SIZE=14

It seems the value of the env var doesn't matter for me when using Hotspot and Heaptrack, just that it is set.

> wsl --version
WSL version: 2.4.13.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5716
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.4061

Jake-Moss avatar May 23 '25 00:05 Jake-Moss

I put this in~/.profile which seems to work pretty well:

# load any xresrouce settings on login:
if [ -e "$HOME/.Xresources" ]; then
    # echo "Not loading xresource file"
    xrdb -load "$HOME/.Xresources"
fi

echo "Xcursor.size: Size" > ~/.Xresources xrdb -load ~/.Xresources

The good news, this works for me. The bad news, I need to do this every time wsl restarts Placing this inside .bashrc kind of fixes it. But only if I launch an interactive terminal first and then my gui app But not when launching an application via the windows side shortcut Where can I put the xrdb -load ~/.Xresources so that it gets picked up when starting an application via its shortcut ? I have tried creating ~/.xinitrc, /etc/X11/xinit/xinitrc and placing it there, but that did not help

Putting this on ~/.profile didn't work for me, unfortunately. The xrdb -load ~/.Xresource command do work, but not going through the GUI app shorcut on windows. I always need to start wsl over terminal

alfablac avatar Sep 08 '25 14:09 alfablac