Arduino
Arduino copied to clipboard
High DPI unusable on Linux
Can't select the menu items, or edit with starting the v1.8.3 IDE on a HDPI screen on Linux (GNOME)
even changing the scaling factor doesn't help make the mouse usable.
the menus do at least work when using keyboard shortcuts, but my 8 year old has kinda lost interest after trying to work out how to make it useful.
I understand that its going to take quite a lot of work to resolve, but :/
Click File > Preferences. Or hold the CTRL key and press the comma ',' key.
These definitely do work on my Ubuntu system using Arduino 1.8.3.
That does a little. But the menus are still mostly unusable
Does GNOME provides a setting for hi-dpi display? How is it set?
@cmaglie not that we found - GNOME's claim to fame is to remove settings that users use - and even the secret settings tool didn't help.
Not sure if this is the right place to post this, but on Ubuntu 17.10 using wayland, manual High DPI scaling works for everything except for the menu items. This isn't an issue that I have with other applications.
As a shot into the dark: check your gtk-font-name
value. I had gtk-font-name "Bitstream Vera Sans 8"
in my ~/.gtkrc-2.0
. Changing font size from 8 to 12 worked for me.
In addition, it's possible to modify the menu font size:
At the beginning of ./arduino script, just add
xrandr --dpi xx
with xx the value needed. In my case, it's 122.
In the above script you can reset xrandr
back to default DPI of 96 by adding the following line to the bottom:
xrandr --dpi 96
as @stapelberg mentioned - his a workaround works ;-)
i posted a detailed way in #9170
basically create a custom .gtkrc-2.0
file with font size you like and start arduino with this file:
GTK2_RC_FILES=my_arduino_gtkrc-2.0.conf arduino
Still seeing this problem in PopOS 20.04 (ubuntu 20.04 base). Weird highlighting of text on mouseover, clicks can't register because everything is off in location.
Its basically unusable :(
Do the following.
- Find the Arduino launch script, it could simply be
/usr/bin/arduino
or some other file called therein, for instance Arch has it at this path/usr/share/arduino/arduino
. - Find the line which actually launches java. For Arch this is the very last line in the file and it looks like this:
"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
- Add the new line:
JAVA_OPTIONS+=("-Dsun.java2d.uiScale=2")
right before the line at point 2.
Everything (text, menu, icons...) will be scaled by a factor 2. You can tune the factor to your screen/taste, however only integers seems to be accepted.
For more details: https://wiki.archlinux.org/index.php/HiDPI#AWT/Swing
The solution for me was to uninstall the flatpak (How the GUI package installer wanted to install things), and install Arduino IDE from the tarball directly according to: https://www.arduino.cc/en/guide/linux. This installed fine, and works perfectly on high DPI. No idea what was wrong with the flatpak install.
This is Arduino IDE 1.8.13 on OpenSUSE TW, installed from the distribution package, on X11, on a Thinkpad X1 with resolution 2560x1440, KDE display scaling set to 200%, and an empty ~/.arduino15/preferences.txt
(Arduino default scaling preferences: scale 100% and autodetect enabled). Arduino IDE interface elements are unusably large, and its windows (such as the preferences window and library) are unusable.
If I disable autoscaling in the Arduino IDE and set scale to 50%, I get reasonably-sized text in the editor, but all UI elements are still enormous, their size doesn't seem to be influenced at all by anything I do in the Arduino preferences.
For whatever reason it does work when I set sun.java2d.uiScale
to 1 in the /usr/bin/arduino
script, even though there is no $JAVA_OPTIONS
set anywhere else:
# Scale UI to 100% to avoid blown-up UI elements
JAVA_OPTIONS+=("-Dsun.java2d.uiScale=1")
"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
I wish in 2020 these things were somehow under control. I would switch to Wayland, but it doesn't support some other things I need.
If all the tips above still not working for you just try using the flatpack version instead of the apt version. Flatpack
Like others have reported, the preferences from within the GUI did not affect the menu for me (Debian bookworm/testing). Settings in gtkrc-2.0 did not do anything. Turns out, that recent versions of java switched to GTK3 for their GUI. What finally worked for me, was to set the shell variable GDK_SCALE: export GDK_SCALE=2 (Took the hint from https://wiki.archlinux.org/title/HiDPI#GUI_toolkits )
This is still a dirty hack. Icons and the corresponding tool tips render a bit mushy. This is to be expected, as each of their pixels turns into a tiny 2x2 square. However, the fonts in the main UI and in the menu render fine and crisp. I get a decent UI on a 4k, 24" monitor. :-)