Bug 452261 - global scale in wayland changes the resolution of screen.
Summary: global scale in wayland changes the resolution of screen.
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.24.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-04 13:00 UTC by rezad1393
Modified: 2022-04-05 08:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rezad1393 2022-04-04 13:00:35 UTC
SUMMARY
***
I have a 14 inch display laptop that has 1080p resolution.
so the default UI is too small on it.
so on X display server I use (the very good) zoom setting in display setting and set it to 150%.
this causes the icons and texts to appear readable for me at a normal distance.
this causes firefox to use a 720p viewpoint but in its about:support firefox knows the system is 1080.
and other apps also see a 1080p display. for example if I use a picture viewer and tell it to show a 1080 picture at natural size it would fill the screen and also would not spill out (pixel to pixel match)

now my issue:
if I switch to wayland session and set the zoom to 150% and re-login, then icons and font are bigger like X but it is because my whole screen have been redefined as a 720p (1080p divided by 1.5) 
this causes a lot of issues. because 720p virtual screen cant be matched to a 1080p physical screen the so plasma (or kde or whoever is responsible) uses something like anti-aliasing that is used in game.

this also causes actual games (like dota from steam)because to have a max of 720p resolution so it is trying to show a matched 720p on a 1080pscreen which makes  to become blurry .

also if I use a picture viewer and open a 1080p picture and tell it to show it at natural zoom it would spill out of screen.
another example is mpv video player.

when I play a movie in zoom x session and full screen it it and press the I key it shows the scaled resolution as 1080p but in wayland it seems to see a 1440p (2*720p) as my full screen scaled resolution.


I think that the X behavior is the correct one and wayland one is a bug because it causes all kind of problems when programs see a 720p virtual screen and then it is shown on a 1080p physical screen.

I remember that some time ago when I was testing this in wayland , the zoom setting would tell me that my screen is going to be 720p after zoom (which means that this is an intended behavior?), and now it doesn't show that, just says 1920*1080 @150%

if I am gonna bug other people software for HiDPI I need a correct base first to test against and wayland is not there like this.
Comment 1 rezad1393 2022-04-04 13:02:59 UTC
by zoom I meant the global scale setting.
also I think this is because of dpi change that in x doesnt change resolution but in wayland does?
Comment 2 David Edmundson 2022-04-04 13:23:18 UTC
This is as intended. 
There is movement to change this.
Comment 3 rezad1393 2022-04-04 13:38:12 UTC
(In reply to David Edmundson from comment #2)
> This is as intended. 
> There is movement to change this.

thank you for the very fast answer.
how it was decided that this was gonna work?
am I missing something about matching virtual pixels to physical pixels that are not whole number factor of each other not being a good thing?

where can I track that "movement"
Comment 4 Nicolas Fella 2022-04-04 23:56:58 UTC
The problem here is XWayland, which Firefox and most games use. XWayland programs only "see" the logical resolution of 720p. Wayland-native programs do not have that restriction.

That said, non-integer scaling is known to cause other problems such as bad icon rendering
Comment 5 rezad1393 2022-04-05 05:28:30 UTC
(In reply to Nicolas Fella from comment #4)
> The problem here is XWayland, which Firefox and most games use. XWayland
> programs only "see" the logical resolution of 720p. Wayland-native programs
> do not have that restriction.
> 
> That said, non-integer scaling is known to cause other problems such as bad
> icon rendering

again, thank you for the fast answer.
so you are telling me that my desktop (the desktop UI ) is the same for wayland and for X when using global scale and they are both at 1080p, but many apps because they are not wayland native and are xwayland, they get 720p? I thought that movement was for "wayland uses zoomed resolution" and not "xwayland uses zoomed resolution". I have less issue this the second.

but is there a program that is completely wayland that I can somehow test the resolution it sees this and be sure?
because the app I use for picture viewing (qview) says that it is both wayland and x compatible and it still uses 720p. and also mpv uses xwayland?

also is there a wayland command or info that shows what the desktop sees as resolution?
not in the setting but a command that I can run? most of them are for X.
Comment 6 rezad1393 2022-04-05 05:34:50 UTC
firefox 720p viewpoint in also present in X too so that is not the difference.
but one thing that is in you point's favor is that I remember testing firefox in wayland zoomed mode and its own UI was blurry and I asked and someone pointed out xwaynad and I change that (dont remember what) and firefox used wayland and it was no longer blurry.

I am trying to move to wayland (maybe even remove X). it has many bug and papercuts (password prompts are not shown in middle of screen) but this is the main one that f...ks with me. if it is only xwayland apps and the kde apps (that I think run as native wayland right?) are ok , and also if I can find way to make movies and picture be shown in 1080p, I can bear the rest because wayland seems to be smoother for me. I get horizontal line in fast videos in firefox run in X but not in wayland.
Comment 7 rezad1393 2022-04-05 08:20:34 UTC
all of these zoom issue I have is because it seems application use dots for size of their UI and font and my laptop had a 155 dpi and also it seems that wayland and X see 96 dpi (the default one) .
so maybe we need to fix the dpi detection first because that is the bedrock of all other assumptions?
I had heard that dpi adn Hidpi was bad on linux but I didnt think it couldnt even see the correct dpi in X?
or am I missing something?

also has anything changed with respect to global scale and dpi in the last two months? because I was testing global scale in X and it seems that if I set the global scale to 100 (down from my 150%) then firefox UI gets small like before but kde UI doesn't change.
even with re-login.
I tested with 200% global scale and that zooms more but the plasma UI (dolphin and so on) there is no diff between 100 and 150% global scale.
that was not the case before.
on wayland the old behavior is still there and with 100 zoom plasma ui is still (like old X) small.