Cursor flickers on primary display when fractional scaling is enable for dual monitors on Ubuntu Desktop 20.04

8,749

Solution 1

Another workaround which worked for me was to set the scaling to different value than 200%, e.g. 175% or 150% both worked for me. It was still close to 200% which I initially wanted, but I am also ok with this. No screen tearing nor impact on the performance in comparison to what other users reported with the 0.9999x0.9999 hack and most importantly I do not see the cursor flickering anymore. Also you can comfortably set this up in the settings.

I am on X1 carbon 7th gen with Ubuntu 20.04 desktop.
Primary display: 1920x1080, scale 100%
Secondary display: 2560x1440 (built-in WQHD), scale 175%

UPDATE: In case your machine seems too slow, check this answer because you might want to avoid fractional scaling completely.

Solution 2

To configure screens with xrandr

Here is a script for using xrandr to modify one display to use fractional scaling while the primary does not scale. Take this and modify it to fit your needs.

xrandr  --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off --output DP-1-1 --off --output DP-1-2 --off  # --output eDP-1 --off --output DP-1-3 --off
echo "turned off all displays except eDP-1 DP-1-3"

xrandr --output eDP-1 --mode 2560x1440 --pos 0x300 --scale 0.7x0.7
echo "Updating on eDP-1"
xrandr --output DP-1-3 --mode 2560x1440 --pos 2560x0 --primary
echo "Updating on DP-1-3"

To fix the mouse flickering bug

As for the flickering, this is a known issue with xorg. There is an open issue waiting to be picked up to fix this bug: https://gitlab.freedesktop.org/xorg/xserver/issues/70

The workaround is to set your non-scaled display to scale at 0.9999x0.9999, this doesn't cause any noticeable difference in the display's scale but I have read it causes some lag and possibly some screen tearing.

Example xrandr configuration script with mouse flicker work around applied

xrandr  --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off --output DP-1-1 --off --output DP-1-2 --off  # --output eDP-1 --off --output DP-1-3 --off
echo "turned off all displays except eDP-1 DP-1-3"

xrandr --output eDP-1 --mode 2560x1440 --pos 0x300 --scale 0.7x0.7
echo "Updating on eDP-1"
xrandr --output DP-1-3 --mode 2560x1440 --pos 2560x0 --primary --scale 0.9999x0.9999 #Scale added her to fix mouse flicker bug https://gitlab.freedesktop.org/xorg/xserver/issues/70
echo "Updating on DP-1-3"
Share:
8,749

Related videos on Youtube

BlueCrustacean5
Author by

BlueCrustacean5

Updated on September 18, 2022

Comments

  • BlueCrustacean5
    BlueCrustacean5 over 1 year

    I am experiencing a mouse cursor flickering on my primary display when I enable fractional scaling. I am running Ubuntu 20.04 desktop on a Dell Inspiron XPS 9380 with Intel UHD620 graphics.

    I have a dual monitor set-up and, as such, I have 200% scaling on my primary screen (13 inches up to 4k) and 100% scaling on my second monitor which sits above and extends the desktop ('join displays'). To achieve this configuration, I enabled fractional scaling in the screen display tab of the settings GUI.

    The scaling is just how I want it to be, but, the cursor flickers very rapidly and erratically on the primary display only. It is unpleasant to look at and very distracting when using any program. The click function works fine, and the cursor tracks perfectly smoothly despite the flickering.

    I have been unable to achieve the same display configuration by using 'xrandr' in the command line, so ideally I will continue to use the fractional scaling setting available in the GUI.

  • littleguga
    littleguga over 3 years
    You saved my eyes! This worked on Carbon 6gen too.
  • Boyan
    Boyan over 3 years
    See, now, that's an excellent example of why this rule works :D
  • QtizedQ
    QtizedQ over 3 years
    Worked on X1 Carbon 7th gen with 4k display as well
  • yuval.bl
    yuval.bl over 3 years
    Great! works on XPS with 4K
  • Paloha
    Paloha over 2 years
    In case your machine seems too slow, check this answer because you might want to avoid fractional scaling completely askubuntu.com/questions/1230620/ubuntu-20-04-gnome-very-slow‌​/…
  • sabujp
    sabujp about 2 years
    you can also just use --scale 0.9999, it will automatically set the y to the same if it is omitted
  • Admin
    Admin almost 2 years
    It's 2022 and all I want is a monitor setup that doesn't require a PhD in configuration management and software engineering. Ubuntu/Debian, please stop the madness with desktop management.