Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wayland DPI / font size and restarting the environment.
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 996

PostPosted: Tue May 23, 2023 5:11 pm    Post subject: Wayland DPI / font size and restarting the environment. Reply with quote

Since wayland is now part of the default desktop profile, I decided to try it out. I'm using KDE/Plasma as my desktop environment.

I use SDDM as my display manager. I can still select session Plasma X11 and that works perfectly.

However, when I tried Plasma (Wayland), well, things sort of worked. However, the font sizes were all wonky.

This is most likely because I have manually told Xorg the physical size of my display. I have this in xorg.conf:

Code:

Section "Monitor"
    Identifier     "Monitor0"
    DisplaySize   311 175
EndSection


So...how can I tell Plasma the correct sizes?

Second thing: How can I emergency-escape from the DE if I run into problems?

In Xorg.conf I have enabled this and can always return to session manager using ctrl+alt+backspace. How to achieve same functionality with Wayland-Plasma?
Code:

        Option  "XkbOptions" "terminate:ctrl_alt_bksp"
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Tue May 23, 2023 8:27 pm    Post subject: Reply with quote

I started using Plasma with Wayland (Nvidia drivers) yesterday. I found that some settings when logging in for the first time were reset for Wayland. For example, left handed mouse had to be reset -- but just for Wayland, the config in X is not changed. Also, in Display, I had scaling set to 125% in X. I found that 100% worked fine on Wayland and scaling was not needed as in X.
For fonts, I had all set to 12pt in System Settings > Appearance > Fonts in X. This had not changed. However, I prefer to use Force DPI of 144, this had been reset to the default of 96. I set it back, logged out and logged back in. And things looked much better.
My suggestion is to set the font size you prefer. If that doesn't work, consider scaling the Display to 125% in System Settings > Display and Monitor > Display Configuration. If that does not produce the desired result, force the FONT DPI to 144 as explained above and log out and back in again.
Note that font DPI seems to have an effect on the System Tray icons. If that has undesired results, your only options are to toggle panel icon size between "Scale with Panel Height" and "Small" in System Tray settings.

As for the ctrl+alt+backspace to kill the X-server, that is still a keyboard shortcut option in System Settings. An xorg.conf file is not required for that to still function in X. The only Wayland equivalent I can suggest is to stop (via killall or other mechanism) "/usr/bin/startplasma-wayland" from the tty or the terminal. This can be done as your regular user and does not need special privileges. This will immediately terminate the session and bring you back to the SDDM login screen. It might be possible to put this command in a shell script and create a keyboard shortcut to that file but I am not sure.
So far, there have been no hang ups like occasionally happen in X and I have not needed to use it.
Back to top
View user's profile Send private message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 996

PostPosted: Wed May 24, 2023 5:16 am    Post subject: Reply with quote

I have to say that this is a step back. Yeah, I guess I can just use the "force DPI" option, but with X I could just tell the physical size of the display in millimeters and it would calculate the DPI automatically. For me, in X, it says

Code:

$ xdpyinfo  | grep dots
  resolution:    157x157 dots per inch


If I forced it to 157, the font sizes started looking correct again. I'm using nouveau driver (with laptop, it has some mobile Nvidia chipset).

However, I'm noticing a bunch of smaller issues still. For example, whenever I move the mouse cursor over any Window's title bar, the cursor vanishes. It works perfectly - I can drag windows around and all, but cursor is gone. When I move the invisible cursor away from such a title bar, it reappears.

...frankly, I think I'll stick with Xorg.
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Wed May 24, 2023 5:26 am    Post subject: Reply with quote

I could be wrong but it is probably better to set it to multiples of 48 (96,144), etc. But that option is only for forced font DPI. It warns that it is better to set the scaling in Display settings, but that wouldn't work for me. Now everything looks normal.
I agree it feels like a step backwards, I cannot get Virtualbox to work well under Wayland nor an onscreen keyboard. So i get how you feel, its frustrating. Input with mouse and keyboard hiccups occasionally.
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Wed May 24, 2023 11:01 am    Post subject: Q Reply with quote

Scale font DPI instead of Display. Or in a few days we can see a new question "Why some screens are blurred" :wink:

1) set theme Breeze – it scales perfectly. Later you can set your own one, but you must be sure this is not a problem of your favorite theme.
2) set Display scale 1:1
3) set font DPI you like. (I set DPI 150 for 2K screen). It is not required to be a factor of 2.
4) Re-login. This is important. :!:

Wayland session may keep settings separately. So if you configured everything in X11 this does not mean it will be configured in Wayland session too.

If some screens still show small glyphs – you must figure out what is that: GTK application, QT application, or maybe it is an application running in XWayland. Once you figured this – you can proceed with docs like this one https://wiki.archlinux.org/title/HiDPI .

If a pointer has different shape/size/visibility when hovering over specific window – again, determine what kind of GUI toolkit it is, and then look at the HiDPI guide.

Regarding Virtualbox. The UI is built with QT and it scales perfectly. The screen of a guest machine (for example you decided to run WinXP) will not be scaled automatically (at least, WinXP is not aware of HiDPI screens). You either scale using a dropdown in Virtualbox or scale in settings of guest OS. For some application running in guest VM you may need to disable pointer integration (examples: fallout 1, fallout 2)
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Wed May 24, 2023 5:08 pm    Post subject: Reply with quote

Quote:
3) set font DPI you like. (I set DPI 150 for 2K screen). It is not required to be a factor of 2.

Thank you for clarifying.
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Wed May 24, 2023 7:27 pm    Post subject: Reply with quote

Quote:
3) set font DPI you like. (I set DPI 150 for 2K screen). It is not required to be a factor of 2.

Maybe it is the system wide font I use, but that doesn't work for me. Anything between 97 and 143 still has DPI of 96 and only will scale to 144 once it is set to 144. I suspect anything over 144 would exhibit similar behavior. Forced DPI of 143 still is same as 96 here so individual mileage may vary.
Back to top
View user's profile Send private message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 996

PostPosted: Thu May 25, 2023 4:55 pm    Post subject: Reply with quote

rab0171610 wrote:
Quote:
3) set font DPI you like. (I set DPI 150 for 2K screen). It is not required to be a factor of 2.

Maybe it is the system wide font I use, but that doesn't work for me. Anything between 97 and 143 still has DPI of 96 and only will scale to 144 once it is set to 144. I suspect anything over 144 would exhibit similar behavior. Forced DPI of 143 still is same as 96 here so individual mileage may vary.


This is actually a known issue with Nvidia's (proprietary) drivers. Google "nvidia dpi 96 linux" for a ton of links on the issue. They always insist on using 96 DPI.

Use nouveau driver or change your GPU to ATI/Intel.
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Thu May 25, 2023 6:18 pm    Post subject: Reply with quote

I run intel card. And it seems this explains the difference. Did not know about that. Thanks for the info.
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Thu May 25, 2023 7:52 pm    Post subject: Reply with quote

Thanks for the explanation Zarhan. Just an update. Ctrl+alt+backspace still works on my machine with Wayland. It may be because I have it set in System Settings> Input > Keyboard > Advanced > Sequence to kill the X server. I have had to use it occasionally. Logging into Plasma desktop sometimes results in black screen with white cursor here.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum