Sample Header Ad - 728x90

Gnome + i3wm on a 4K display - ruined my DPI scaling in Gnome

3 votes
0 answers
2197 views
I have an issue with the user interface scaling under Gnome 3.38. I am using it only on the internal display of a Dell XPS 15 inch laptop with a 2160p 4K display. Nvidia dGPU with proprietary driver. Wayland is disabled, I'm on a standard xorg session. Before installing the i3 window manager, the UI Scaling setting in gnome-settings worked as expected and applied to all the UI elements. Today I installed i3. Since the standard configuration of i3 left all the fonts unscaled and tiny, I created a new file ".Xresources-i3wm" in my home directory with the following content:
Xft.dpi: 192
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
Xcursor.size: 80
For i3wm to load this configuration on login, I modified the i3-config under ~/.config/i3/config, adding the following line: exec_always --no-startup-id "xrdb -merge ~/.Xresources-i3wm" That works and the window manager now launches with the correct *2 scaling on login. After logging into a Gnome session again, SOME elements of the UI did not scale correctly anymore. Affected Shell elements are: The Gnome Top Bar font size, button font sizes, window title bar font sizes and app-icon font sizes in the Gnome App Launcher. Also I've noticed that Java Swing GUI Applications with Gtk+ Look and Feel do not recognize that "Scale" under gnome-settings->Displays is already set to 200%. They now scale to double the size (400%) since "GDK_SCALE=2" is set as an environment variable. I was able to workaround the issue by doubling the Fontsizes in the Gnome Shell Theme *.CSS file. That fixed the Top Bar and App Launcher fonts, but not the ones on windows's title bars. If I export $GDK_SCALE=1 and launch a Java App with Gtk+, I get the correct scaling but afterwards the $GDK_SCALE is automatically set to 2 again, for whatever reason. Since this occured, I reset my dconf, switched Themes back and forth using gnome-tweaks, switched resolution back and forth, rebooted the system several times and played with "xrandr --dpi" setting. All of this didn't help, it looks like i3wm and me screwed up the DPI scaling within Gnome. This is the output of "xrdb -query -all" for me, under Gnome right now:
Xft.dpi: 192
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xcursor.size: 96
Xcursor.theme: Adwaita
I hope somebody can help me out with this. Thanks in advance, Euda
Asked by Euda (31 rep)
Mar 21, 2021, 08:52 AM
Last activity: Apr 13, 2022, 11:15 AM