GithubHelp home page GithubHelp logo

mind-overflow / gnome-fs-duplicate-cursor-fix Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 23 KB

Fix Ubuntu/GNOME's "duplicate cursor" fractional scaling bug.

Java 98.52% Shell 1.48%
ubuntu gnome x11 xorg cursor duplicate mouse

gnome-fs-duplicate-cursor-fix's Introduction

GNOME Fractional Scaling duplicate cursor fix

Fix Ubuntu/GNOME's "duplicate cursor" fractional scaling bug.

Warning: this tool is no longer maintained. I have moved to another distro and have no time to track GNOME's upstream neglected bugs.

How to install

Noob-friendly installation guide

Read this blog post: https://www.mind-overflow.net/post/fixing-ubuntu-fractiona-scaling-bug/

Standard install:

  1. Enable X11 fractional scaling:
gsettings set org.gnome.mutter experimental-features "['x11-randr-fractional-scaling']"
  1. Configure your monitors accordingly:
  • Go to "System Settings" -> "Monitors" and move/scale them to your preference.
  1. Install Java:
sudo apt install default-jre
  1. Download latest version of .JAR file from releases:
wget -O ~/ScreenScalingFixer.jar https://github.com/mind-overflow/gnome-fs-duplicate-cursor-fix/releases/download/v1.0/ScreenScalingFixer-1.0-SNAPSHOT.jar
  1. Create a directory in your home folder and put the JAR file inside of it:
mkdir ~/screen-scaling-fixer/
mv ~/ScreenScalingFixer.jar ~/screen-scaling-fixer/ScreenScalingFixer.jar
  1. Create a startup script:
echo "sh -c \"cd ~/screen-scaling-fixer/ && java -jar ~/screen-scaling-fixer/ScreenScalingFixer.jar\"" > ~/screen-scaling-fixer/start.sh
chmod +x ~/screen-scaling-fixer/start.sh
  1. Enable the startup script:
mkdir ~/.config
mkdir ~/.config/autostart
printf \
"[Desktop Entry]\n\
Name=fs-fixer\n\
GenericName=fs-fixer\n\
Comment=fix gnome scaling duplicate cursor\n\
Exec=sh -c ~/screen-scaling-fixer/start.sh\n\
Terminal=false\n\
Type=Application\n\
X-GNOME-Autostart-enabled=true\n\
X-GNOME-Autostart-Delay=1\n" > ~/.config/autostart/fractional-scaling-fix.desktop
chmod +x ~/.config/autostart/fractional-scaling-fix.desktop
  1. Run the JAR file and let config.yml generate:
cd ~/screen-scaling-fixer
./start.sh
  1. Edit config.yml accordingly:
enable: false # set this to true, or the script won't run!
delay: 2000 # chose how long to wait after login before restarting GNOME.
monitor-connector: 'DisplayPort-1' # chose ONE monitor that requires fractional scaling to be enabled. Don't worry if you have multiple ones.
scale: 1.5 # set the desired fractional scale.

Explanation:

  • delay: this is mandatory, because if you try restarting GNOME without any delay after login, it will not be restarted. Waiting a few seconds (~2) should be enough.
  • monitor-connector: this is a monitor that requires fractional scaling. You should be able to gather its connector name by using command xrandr.
  • scale: the scale of the chosen monitor. if you have multiple monitors, just chose one, as we only need to apply those changes to a single one to fix it for everyone else.
  1. Final step: log out and log back in.

How this works

The concept behind this fix is simple.
If you enabled the experimental fractional-scaling feature in eg. Ubuntu 20.04, you probably noticed that, upon login, a dead cursor gets stuck on screen, and a second bigger one appears.
This problem is fixed, however, if you switch back to 1.0x scale, apply, and then get back to your desired one.
To automate this process, I developed a small Java tool that automatically does it after logging in.
You simply have to input your screen settings in config.yml, logout, re-login and you should notice your screen flashing twice.
The dead cursor should disappear.

gnome-fs-duplicate-cursor-fix's People

Contributors

mind-overflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gnome-fs-duplicate-cursor-fix's Issues

Solved by switch to ubuntu on wayland

On the startup page which I have to enter the password, switch to ubuntu on wayland by a setting icon on the right below corner, and I solved the duplicate cursor problem.

It's not working on Lenovo Yoga 13s

There are two versions of cpu for this model, they are INTEL and AMD, Mine is AMD R5 5600U, I don't know this will effect display or not.

pixel size is 2560x1600

and my system is ubuntu 20.04 LTS

In settings > displays, If I disable "Fractional Scaling", There are only two options without "125%, 150%, 175%", left 100% too small and 200% too big.

So I enabled "Fractional Scaling", choosed "150%":

image

But unlike as yours, The mouse pointer is bigger in lock screen and smaller after loged in. The bigger mouse pointer will stuck once loged in.

How can I let script take effect?

Thanks.

1.502347469329834 instead of 1.5

Hi dev!

I'm using Lenovo Xiaoxin Pro16, which has a screen of resolution 2560x1600. I tried to set 'scale' to 1.5 in config.yml but the script don't work (After executing the script, the scale is 100% instead of 150%). Here is the output:

Loading config...
Done!
Enabled: true
Delay: 10000
Monitor name: eDP
Monitor scale: 1.502347469329834
Main element: monitors
1 - Current node: configuration
    2 - Current node: logicalmonitor
        3A - current node: scale
            Current scale: 1.5
        3B - current node: monitor
            4 - current node: monitorspec
                    5 - current node: connector
                        Current connector: eDP
Restarting GNOME...
line: bs true ""
exit: 0
Restarting GNOME...
line: bs true ""
exit: 0

I fixed that by setting 'scale' to 1.502347469329834 in config.yml. Now the script works perfectly.

Support of Budgie?

Hello!
Your script on gnome works great! The annoying double cursor is gone!
Unfortunately, since I migrated to Budgie (since gnome had serious issues with full screen applications) it doesn't work any more. Probably because this script is heavily tied with gnome.
Since Budgie is basically gnome-based, and the annoying double cursor is there, any idea what I should do to overcome this problem?

Thank you!

Duplicate cursor gets stuck in the middle of the screen after utilising script

Hi, i ran the script and followed the installation instructions, but now, on startup, the duplicate cursor gets stuck on the middle of the screen (at the password fill in box), while the working cursor pops up on the right bottom edge of the screen. Not sure what's going wrong. Any help will be appreciated. A screenshot is attached that will hopefully give some idea of the location of the duplicate pointer. It's basically bang in the middle of the screen...
Screenshot from 2022-01-21 01-57-03

Doesnt work with Zorin OS 16 and Lenovo Ideapad 5

Hello,
I am using Zorin OS 16 (Based on ubuntu 20.04) with gnome and i am expiriencing this annyoing bug.
My laptop: Lenovo Ideapad 5 14ARE05 (Ryzen 4500U, 16GB RAM, 1920*1080 14`` display)
This script unfortunetly doesnt work for me. After runnning the screen flickers but no matter what scale i enter into the config.yml it always reverts the screen back to 100%.
Config.yml:

enable: true
delay: 1000
monitor-connector: 'eDP'
scale: 1.5

terminal output:

Loading config...
Done!
Enabled: true
Delay: 1000
Monitor name: eDP
Monitor scale: 1.5
Main element: monitors
1 - Current node: configuration
    2 - Current node: logicalmonitor
        3A - current node: scale
            Current scale: 1.25
        3B - current node: monitor
            4 - current node: monitorspec
                    5 - current node: connector
                        Current connector: eDP
Restarting GNOME...
line: bs true ""
exit: 0
Restarting GNOME...
exit: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.