drawing icon indicating copy to clipboard operation
drawing copied to clipboard

Mouse size is 2x smaller than it should be on x11 w/ 2x scaling enabled (for HiDPI)

Open rbreaves opened this issue 2 years ago • 7 comments

Description

The mouse cursor is 2x smaller than it should be and am unable to scale it up as a flatpak using env variables or overrides for xcursor scaling.

Things I tried were this..

sudo flatpak override --env=XCURSOR_THEME=Adwaita com.github.maoschanz.drawing
sudo flatpak override --env=XCURSOR_SIZE=72 com.github.maoschanz.drawing
flatpak run com.github.maoschanz.drawing

# attempt 2
env GDK_BACKEND="x11" GDK_SCALE=2 CLUTTER_SCALE=2 GDK_DPI_SCALE=2 flatpak run com.github.maoschanz.drawing

# a lot of things scaled up but not the mouse cursor, stayed the same size.

Steps to reproduce the bug

  1. Install Ubuntu 20.04 or newer (or Ubuntu Budgie) - login to x11 desktop
  2. Runs these commands, logoff and back on. (best if you have a 4k laptop)
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]"
gsettings set org.gnome.desktop.interface scaling-factor 2
  1. Install drawing from a flatpak and observe small cursor.

System

  • Device (desktop computer/tablet/phone/...): MacBookPro11,4 1.0
  • OS: Ubuntu 20.04.3 LTS x86_64
  • Desktop environment: Budgie
  • Package format: flatpak
  • App version: 0.8.5

rbreaves avatar Jan 18 '22 01:01 rbreaves

only when hovering the canvas, or does it happen with the UI elements (buttons, menus, etc.) too?

maoschanz avatar Jan 18 '22 02:01 maoschanz

@maoschanz All parts of the application, so yea canvas & the UI elements.

Normally I'd have set this

env GDK_BACKEND="x11" GDK_SCALE=2 CLUTTER_SCALE=2 GDK_DPI_SCALE=2

like this

env GDK_BACKEND="x11" GDK_SCALE=2 CLUTTER_SCALE=1 GDK_DPI_SCALE=1

But I wanted to see if the cursor would scale at all with those variables all set & yea that didn't work, but yea the UI became massive when setting those like that lol. You probably only need to check for GDK_SCALE but you could check other parameters individually too I guess. People seem to set things in so many different ways..

I am working on a script to help people scale their Gnome and Budgie DEs and trying to make as few individual edits as possible. This is the first app of its kind that I have seen that didn't just work with my scaling method or using the GDK Window Scaling feature combined with xrandr scaling.

https://github.com/rbreaves/betterScale

rbreaves avatar Jan 18 '22 02:01 rbreaves

it could be a side-effect of my attempt to hardcode the scaling of the image on the canvas as 100%, as a temporary fix to #207 until proper HiDPI support is implemented (#243)

https://github.com/maoschanz/drawing/blob/bdc46f1631a8bbf2b9af4aad61dd34e2551055e0/src/image.py#L52

but it's very weird, it shouldn't do that, the only downside should be a very tiny image with poor CPU performance

sadly the SDK version "41" doesn't work correctly regarding env variables, so nowadays i can't even get the absurdly big UI at all to test it

maoschanz avatar Jan 18 '22 02:01 maoschanz

Well funnily enough literally everything about your app scales perfectly under x11 and HiDPI when using my specific scaling method except for that mouse cursor lol.

I think everyone pretty well knows the horrible state Linux is in in terms of HiDPI support. I hear things are better under wayland but atm I prefer some features that only x11 can give me. I would like to flesh out betterScale more and start to get linux users and distros to either adopt it or re-implement their current scaling methods and UI to essentially follow the same type of implementation.

From what I have seen under most distros is simply a very broken x11 fractional scaling option if there is one at all. If it is not broken then a sliding scale of like 4 levels which is hardly enough.. or early on insane CPU usage. Seems the CPU usage has come way down or I wouldn't be using it right now.

rbreaves avatar Jan 18 '22 05:01 rbreaves

Really great app by the way, I am very impressed with its tight UI and focus. You could definitely grow this into something much larger imo. I also love that you kept the menu structure working with Global Menus like the vala-appmenu or Unity. Many devs don't implement that as much these days or flatpak packaging will sometimes prevent it from working (of course not in this case - it's working great!).

rbreaves avatar Jan 18 '22 05:01 rbreaves

for some reason, on my office's desktop computer it works fine (flatpak, 20.04, X11, 200%) the only difference is that it's GNOME Shell

maybe there is also something with the mouse cursor theme(s) installed on the system, versus those in the flatpak sandbox?

maoschanz avatar Jan 18 '22 08:01 maoschanz

Huh.. that is odd. I’m running Ubuntu Budgie 20.04 but I’d figured the cursor issue would have shown up for gnome or Budgie. :/

I am actually scaling up my resolution slightly via xrandr virtual frame buffer & then back down but that should be virtually undetected by any app.

rbreaves avatar Jan 18 '22 14:01 rbreaves