[SOLVED]Hidpi issues with apps on xfce, (Use Cinnamon)

I used xfce4 whilst on Arch and had a really hard time trying to get the scaling of apps to scale correctly. I found some stuff out on my own and was corrected about some stuff by people on the forum. I thought it was all fixed and sorted but sadly I was mistaken. I gave up and have currently installed gnome as that’s the only DE I think works out the box. I realise I bought the wrong laptop for Linux (well for a beginner user). I would much rather be using xfce than gnome but if I have to I’ll stick with it as I don’t have much choice.

I’m pretty sure dealing with this matter is above my paid grade and I understand if I don’t get hand holding help as I don’t think it is a little issue. But I just thought I’d post this and see if it was possible for me to get help and be able to use my DE of choice. I’m going to be busy today but if someone thinks it is possible then I’ll reinstall xfce hopefully tomorrow.

First I changed the scaling to x2 in appearance > settings

The following two commands are whilst I have gnome installed.

neofetch


[muj@Blackstone ~]$ neofetch
                     ./o.                  muj@Blackstone 
                   ./sssso-                -------------- 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: 20QD00KWUK ThinkPad X1 Carbon 7th 
             `-/ossssssssssssso/.          Kernel: 5.9.2-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 13 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 981 (pacman) 
       `.://osssssssssssssssssssso++-      Shell: bash 5.0.18 
      .://+ssssssssssssssssssssssso++:     Resolution: 3840x2160 
    .:///ossssssssssssssssssssssssso++:    DE: GNOME 3.38.1 
  `:////ssssssssssssssssssssssssssso+++.   WM: Mutter 
`-////+ssssssssssssssssssssssssssso++++-   WM Theme: Adwaita 
 `..-+oosssssssssssssssssssssssso+++++/`   Theme: Arc-Dark [GTK2/3] 
   ./++++++++++++++++++++++++++++++/:.     Icons: Adwaita [GTK2/3] 
  `:::::::::::::::::::::::::------``       Terminal: gnome-terminal 
                                           CPU: Intel i7-8565U (8) @ 4.600GHz 
                                           GPU: Intel UHD Graphics 620 
                                           Memory: 1990MiB / 15688MiB 

                                                                   
                                                                   

inxi -Fxz


System:    Kernel: 5.9.2-arch1-1 x86_64 bits: 64 compiler: gcc v: 10.2.0 Desktop: GNOME 3.38.1 
           Distro: EndeavourOS 
Machine:   Type: Laptop System: LENOVO product: 20QD00KWUK v: ThinkPad X1 Carbon 7th serial: <filter> 
           Mobo: LENOVO model: 20QD00KWUK v: SDK0J40697 WIN serial: <filter> UEFI: LENOVO v: N2HET57W (1.40 ) 
           date: 10/08/2020 
Battery:   ID-1: BAT0 charge: 46.6 Wh condition: 52.0/51.0 Wh (102%) model: LGC 5B10W13930 status: Discharging 
CPU:       Info: Quad Core model: Intel Core i7-8565U bits: 64 type: MT MCP arch: Kaby Lake rev: C 
           L2 cache: 8192 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 32012 
           Speed: 1000 MHz min/max: 400/4600 MHz Core speeds (MHz): 1: 1000 2: 1000 3: 1000 4: 1000 5: 1000 
           6: 1001 7: 1000 8: 1001 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: Chicony Integrated Camera type: USB driver: uvcvideo bus ID: 1-8:2 
           Display: wayland server: X.org 1.20.9 compositor: gnome-shell driver: i915 
           note: display driver n/a - try sudo/root resolution: <xdpyinfo missing> 
           Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:     Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo driver: sof-audio-pci 
           bus ID: 00:1f.3 
           Sound Server: ALSA v: k5.9.2-arch1-1 
Network:   Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel port: 2000 
           bus ID: 00:14.3 
           IF: wlan0 state: up mac: <filter> 
           Device-2: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: kernel port: efa0 bus ID: 00:1f.6 
           IF: enp0s31f6 state: down mac: <filter> 
Drives:    Local Storage: total: 476.94 GiB used: 52.42 GiB (11.0%) 
           ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN730 SDBQNTY-512G-1001 size: 476.94 GiB 
Partition: ID-1: / size: 451.57 GiB used: 52.42 GiB (11.6%) fs: ext4 dev: /dev/nvme0n1p2 
Swap:      ID-1: swap-1 type: partition size: 16.85 GiB used: 0 KiB (0.0%) dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 38.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 0 
Info:      Processes: 268 Uptime: 14m Memory: 15.32 GiB used: 2.62 GiB (17.1%) Init: systemd Compilers: 
           gcc: 10.2.0 Packages: 981 Shell: Bash v: 5.0.18 inxi: 3.1.08 

The issues:

I first notice albert way too small, I scoured the internet and found this fix

I modified the Exec=line in /usr/share/applications/albert.desktop to this:

Exec=/usr/bin/env QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 /usr/bin/albert %u

It worked but someone on the forum told me that is just for albert so to make it apply to all apps I should add the environment variable to ~/.xprofile

So I added export QT_AUTO_SCREEN_SCALE_FACTOR=0 and export QT_SCALE_FACTOR=2 and /usr/bin/albert & to my ~/.xprofile

I thought it was applying the environment variable for all apps on my user session.

Then gimp was tiny too I found and applied this fix

https://wiki.archlinux.org/index.php/HiDPI#Gimp_2.10

Then leafpad was tiny. I added leafpad to my .xprofile without the & sign hoping it would be applied with the environment variables (because obviously I don’t have a clue what I’m doing) then I couldn’t reboot.

I edited the kernel parameters with single then Ctrl + x booted and deleted leafpad from .xprofile I’m assuming there would be loads of other apps which would be tiny too. Is there a good way to globally sort out this scaling issue?

Also the notifications setting weren’t working properly. I turned chrome notifications off in xfce but they kept coming. I’m assuming chrome settings were over-riding the xfce settings.

I first thought this would probably be too much to ask for help with, that’s why I went and installed gnome. So if it is too much then I’ll just stick with gnome.

Let me know,

Thanks in advance.

I also forgot, In the window manager settings under theme I think it was, when I changed the theme to anything other than default the borders around the windows went super skinny.

Only for Qt-based apps. Xfce itself and Gimp are GTK.

I don’t have a 4K screen, only 1440p, but for me it was enough to increase DPI in /etc/lightdm.conf (from the top my head) to get a reasonable appearance.

In xfce everything looked fine size wise once I changed the scaling in appearance > settings to x2 except certain apps.

Are you saying if I do everything I already did before but also changed a value in `/etc/lightdm.conf that should fix it?

If you increase the DPI on top of the 2x scaling and all the rest you did, it could be that everything appears too large.
It’s really difficult to tell, but I think you’re on the right track.

I suggest you read the HiDPI article you linked above in full if you haven’t done so yet.
There are so many possible ways.
I only increased DPI in LightDM’s config and added the same value for Xft.dpi to ~/.Xresources.
But maybe that’s not enough in your case with a 4K screen… Someone else using such a screen can help you better I guess :wink:

lol, I have read that page and many other pages link to it so many times, not with much understanding though. Thank you for your reply highlighting how you implemented things, I will go back and look at it taking into account how you did it.

Archwiki sayws:

Environment variables for Xorg applications can be set in xinitrc, or in xprofile when using a display manager, for example:

~/.xinitrc

not ~/.xprofile

so as far as i understand you do not need to add every app to .xinitrc only like that to set the varables for all qt-apps:

export QT_AUTO_SCREEN_SCALE_FACTOR=0 
export QT_SCALE_FACTOR=2

all this in relation to use XFCE4,different for other DE’s having a more complete support for hdpi like GNOME or cinnamon… it is true that xfce4 not completed the support for hdpi currently, may it will get better with the next release.

I am actually just looking into cinnamon at the moment. That’s probably the best option for me now at the moment.

I’m totally confused about .xinitrc. just don’t get it. I tried doing it a few times following the wiki but wasn’t successful. I thought .xprofile was for someone using a display manager and .xinitrc for window managers.

Anyways if Albert works on cinnamon I’ll probably just stick with it. I think some things are best for me to learn later.

Thank you @joekamprad

1 Like

Archwiki is very unprecise on that for sure… i do not understand it the same as you :wink:

lol, I’m sorry you don’t clearly understand it, but I feel better I’m not alone. :sunny:

1 Like

This is the problem with the Arch wiki. It doesn’t really explain it! You have to try to understand what they mean. :crazy_face:

Edit: Supposedly the next version of Xfce which is coming shortly has better support for HiDpi. Maybe you can wait a few weeks.

Sounds like it’s too late for now :grin: However - here is a post I made elsewhere, and haven’t yet made into a wiki for here :blush:

I am running a 4K (3841x2160) on a 28 inch monitor, and I managed without going all the way to x2 scaling. Also the environment variables for QT can be put several different places and will work - I put them in ~/.profile as:

export QT_SCALE_FACTOR=1.5

which takes care of most QT apps I use, including Featherpad (leafpad upgrade) and kid3-qt and…

Browsers, especially chrome-based, seem to need their own settings too - but I think that’s in the post above…

1 Like

Yes, Yes, damn I wish that wasn’t the case. I am literate, and could have learnt so much with the time I’ve spent. If only the wiki was written for one who doesn’t know. I mean why write a wiki for people who already know? nice reminder?

@freebird54, never too late. lol well maybe just a bit, I’m quite enjoying cinnamon right now and I didn’t have to do anything.

But I will read and learn from what you’ve posted so thank you very much. :smile:

Cinnamon is great. Just make sure you turn off window effects in Effects if that is what it’s called? Menu/effects/window effects? I think it’s the first item. The reason is because when your cursor hovers over the welcome screen you will get transparency of the boxes usually. With it off there are no issues.

1 Like

Cheers @ricklinux I’ll do that, but I think I’m going to try first @freebird54’s instructions tomorrow with xfce see if I can get it working. If not I’ll fall back to cinnamon.

I’m no expert and I’ll probably get hung for heresy, but I’ve found the Arch Wiki is not always right in every situation. Yes, it’s the best Linux has in my opinion, but it is not the law. The operating systems that surround the kernel are, and always will be, a work in progress, just as the kernel is. This applies to Arch too: we live; we learn through experience; we progress. If we find solutions then they are as valid as any other wiki. Linux users are all in this together whatever we may think, agree, or disagree on. :grin:

1 Like

I’ll make comments as I go.

@freebird54 I’m just going through your instructions now. The easiest and best fix obviously is just changing the screen resolution. The only issue I’m finding with this fix is the mouse cursor. Either the fonts are a tad bit too small or if I change the resolution so the fonts are perfect then the cursor is massive, and it’s not possible to make the cursor smaller in the settings as the settings are already on the lowest 16. Because of my lack of knowledge on the subject matter of screen resolution etc I’m not too sure what I’m losing out on. You mentioned that 1920x1080 gives One about half the screen real-estate. Does that matter? lol I don’t know.

The issue with the second option is that whilst changing the scaling to 2x works perfectly it isn’t a comprehensive fix like changing the resolution is. leafpad, gimp and albert are too small.

ahah, I think if I changed the screen resolution to 2560x1440 and the Font DPI to 120, I think that is the fix. But I’m losing out on my screen real estate as you mentioned, lol whatever that means. just noticed too though that when I hover the cursor over the top panel or top border of certain system windows (like the settings window) that the cursor becomes bigger, not chromes window, otherwise the cursor is fine.

haha you dealt with the window manager issue!

If a person does your final ‘tweak’ which I haven’t yet or fully read through, do they not implement the aforementioned fixes? I’ll just revert all the changes and try your final fix.

Didn’t know where within my .bashrc file to paste the environment variables so I just pasted them above the alias commands leaving a blank line above and below them and then I ran source .bashrc

I’m taking it that your final ‘tweak’ is done on top of the first fixes. lol sorry my bad, reading up and down your instruction, implementing them and righting comments was a bad idea, I’m confusing myself.

Okay from the ‘steps to a more nuanced…’ I followed your instructions down to your EDIT but at the first sudo mv..... command I stopped because I got an error saying no such directory. also I edited vim /usr/share/applications/google-chrome.desktop with Exec=/usr/bin/google-chrome-stable --force-device-scale-factor=1.5 %u I rebooted and things are better but still very small. I was lucky though because I had done something similar with albert.desktop otherwise I wouldn’t have had a clue where to edit the google-chrome.desktop file.

Honestly if you don’t have the time to reply that’s not a problem. I just wanted to give you my feed back on your instructions and as you can tell I’m not very computer literate but love Linux so am struggling with it. I’ve probably made some stupid mistakes etc. Also I can happily go to cinnamon no problem so it may not be worth your time anyway.

I’ll keep xfce on my laptop for a day or so anyway with just the resolution changes for now and a fat mouse cursor lol.

On behalf of the many people who will surely benefit and myself thank you for the time you took in writing your instructions.

is also a place for that right :wink:

1 Like

If the size is not enough, then –force-device-scale-factor=1.5 is not written in stone - just a suggestion. In your case, try –force-device-scale-factor=2 for a straight doubling of its effective size.

The mouse cursor size is one main reason I don’t use scaling in general - what I end up doing is to set the mouse cursor size UP to 64, while leaving scaling and resolution changes alone. The font size AND dpi changes together handle most other things fine.

Gimp appears to be a bit small (but on my screen, usable) - but can be tweaked as well, apparently (haven’t done it yet). If you:

sudo leafpad /usr/share/gimp/2.0/themes/System/gtkrc

and where you see:

# font_name = "Sans 11"

make it into something like:

font_name = "Sans 16"

by removing the ‘#’ character (uncommenting it) and changing the font size value to something you appreciate. Many specific programs can be separately tweaked this way (with research!) if they remain too small. Unfortunately, they all seem to have their own ideas about HOW to do that!

Have you tried featherpad instead of leafpad, by the way? Much more capable - has syntax highlighting (colour by usage) and both light and dark modes, and LOTS of preferences - was well as being sized by the QT_SCALE environment variable…

Hope this helps - and it CAN usually be owrked out - just not quickly! :grin:

I should have thought and tried that.

Yes I have applied that fix in the past for gimp.

It did help thank you, lol Yes I’ve realised that Linux takes patience, with more Linux knowledge it’s less of a struggle though I guess. One wrong dot and it all goes wrong. :rofl:

I think I’ll go back to cinnamon for now and in the future when Xfce gets better Hidpi settings then I’ll switch. Hopefully this post will benefit others who have this issue.

You know when I first saw your name and wiki contributor I thought you contributed to the Arch wiki. Also thought it was strange I think you mentioned you have to read the Arch wiki many times too. It must be harder writing pages for a wiki so everyone of all levels can understand it but a wiki like that can make it possible for anyone who can read to learn Linux.