-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hidpi: Exclude applications from scaling #1047
Comments
Scale is set per output in wlc. To be able set application/window specific scaling parameters this feature would need to be provided by wlc at first. |
wayland protocol itself is per-output scale, so how do you expect wlc to change it? |
I don't have too much knowledge about the inner workings of wayland or wlm or sway and I'm not too sure how much is handled in wlm or the layers below it, so treat the following with caution. As far I understand the wayland protocol you have actually two scaling variables and nothing actually forces per-output scaling. Wayland simply allows per-output scaling, something X11 doesn't. Wlc/sway could tackle the issue in several ways, although I don't know which of these things are actually in the scope the respective libraries and don't need some stuff from some layers below. This leaves Xwayland as an issue. According to SirCmpwn we can't scale different X11 applications differently. Maybe this can be sidestepped via starting multiple Xwayland instances, one for each scaling factor. I think I read somewhere that this should be possible, altough the place I read it wanted it for security reasons. This posibility of this is completely out of my knowledge though. |
Damn, it seems the Xwayland issues can't be sidestepped that easily: https://bugs.freedesktop.org/show_bug.cgi?id=93315#c9 and the following comments. |
Would it be possible to disable scaling for xwayland apps entirely? I think some of them have some way to scale themself, like chromium. Personally, I'd prefer a few tiny apps over some blurry apps |
Can this issue be revisited with wlroots? It's a perfect solution for applications like firefox where you can configure the application to upscale itself and the only missing link is xwayland. Configuring an override for the surface scale value on a per-application basis neatly works around this. I would write a patch myself but after skimming through the code for 2 hours and asking on IRC (no response) I still have no idea where to start. Any guidance would be much appreciated - firefox is the only application that's stopping me from enabling sway's scaling right now. |
This is not really feasible, no. |
Unfortunately it's not that simple. If you change how xwayland apps are scaled, you need to change how input events are processed and how outputs are exposed. |
@emersion Thanks a lot for your response. Since I'm not familiar with this codebase it's super hard for me to come up with an idea that's easy to implement. All I want is for my firefox to not be blurry on a highdpi display. That's it. And if the only way is some dirty hack that breaks upscaling entirely, so be it. (I remembered some idea about running all of xwayland at highdpi and then downscaling as necessary but I guess that's basically the same as telling firefox to do its own scaling) Any ideas at all how I could approach this? |
You could try running the Firefox Wayland port. Or just wait for them to support it in the main build. |
@RyanDwyer Sadly, the state of Firefox Wayland can only be described as "hot garbage" right now - it's completely unusable with sway (I tried both the gnome flatpak nightly and building it myself from the repo). It honestly looks like it's going to take 1-2 years at least for this to be ready. For example, any attempt to use the address bar instantly crashes the entire browser. |
I'm not interested in upstreaming Xwayland hidpi hacks. If you're itching to write some this code for this problem, contribute to Firefox on Wayland. |
firefox wayland is perfectly usable for me; the main issue is that they create seats all the time and we don't handle that well (There's a workaround here: swaywm/wlroots#1041 (comment) ), but past this on a daily basis the wayland-specific bugs are minor enough.. There just isn't anyone fixing them on their side, so, yeah; if you have time to help I'm sure they'd take patches. |
@martinetd Very interesting. What exactly are you using? Again, both the nightly and my own build crash as soon as I use the address bar and hidpi scaling doesn't really work either, I basically get a non-scaled UI layout with scaled contents that keep clipping over edges everywhere. Looks funny but not usable. (also your link is wrong I think?) @SirCmpwn Of course I wouldn't try to upstream some awful hack but is it really too much to ask for some advice on creating a quick fix just for myself? All I'm looking for is any way at all to get a usable hidpi wayland desktop without committing entire months of my life to it and I'm almost there - but a blurry web browser (the application many use >50% of the time) in 2018 is a complete non-starter, I hope we can at least agree on that. I would greatly appreciate some technical background on why it's basically impossible to run xwayland at scale=2 and downscale as necessary when it's currently running at scale=1 and upscaling as necessary. It seems so simple on the surface I just want to understand why this is so hard. |
I'm sure we can agree on that. But we don't seem to agree that doing the correct fix is better than doing a bad hack. Contribute to Firefox and everyone wins. |
Some applications, especially X11 applications, support hidpi, but currently do not support waylands internal scaling protocol for signaling this to sway. It would be nice to be able to disable sways scaling for certain windows (e.g. via an environment variable or prepended command) to get sharp scaled rendering nevertheless.
This would allow a smoother transition to sway/wayland for hidpi-users, especially as this affects both chromium and firefox.
I'm not sure whether the capabilities in wlm exist for that, maybe a similar feature request should be opened there as well.
The text was updated successfully, but these errors were encountered: