Skip to content
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

Disable scaling of xwayland applications #5917

Closed
Hubro opened this issue Dec 28, 2020 · 2 comments
Closed

Disable scaling of xwayland applications #5917

Hubro opened this issue Dec 28, 2020 · 2 comments
Labels
enhancement New feature or incremental improvement

Comments

@Hubro
Copy link

Hubro commented Dec 28, 2020

In short, please make it possible to disable scaling of xwayland applications.


When "scale 2" is set for an output, my understanding is that all wayland native applications are scaled to 2x the "normal" size, and all xwayland applications are "stretched out" to match the scale of the native applications. This is great if you need to use displays with different scaling and you only use a few X applications.

However, it's absolutely horrible if you only use one display and the majority of your applications run through xwayland. Now a select few of my applications (specifically my top bar, notifications and my terminal emulator) are sharp and pretty much all my other applications are blurry, including my browser, chat applications and code editor.

For cases like mine wouldn't it make sense to completely disable the upscaling of xwayland applications? That way we can set Xft.dpi in .Xresources to the appropriate value and all our applications can be nice and sharp. From my ~2 hours of Googling this is not currently possible, and I haven't even been able to determine who is responsible for the xwayland scaling. Is it Sway or xwayland itself?

The only hacky workaround to my problem I've been able to find is to completely disable scaling in Sway (scale 1), then set Xft.dpi to a sane value and somehow manually force scaling for all native wayland applications. As I have no idea how to do that last part, I'm not a fan of this solution.

Would it be a large task to allow us to disable xwayland scaling?

Is there an alternative solution to this issue that I have missed?

@Hubro Hubro added the enhancement New feature or incremental improvement label Dec 28, 2020
@rpigott
Copy link
Member

rpigott commented Dec 28, 2020

When "scale 2" is set for an output, my understanding is that all wayland native applications are scaled to 2x the "normal" size, and all xwayland applications are "stretched out"

Any application that renders at a scale different from the configured output scale is rescaled by sway. Wayland applications will choose to render at the output scale and report their effort to sway, so they are not rescaled. X applications have no method to report their own scale, in Wayland or X, so the current status quo is to pretend they always report "scale = 1".

From my ~2 hours of Googling this is not currently possible, and I haven't even been able to determine who is responsible for the xwayland scaling. Is it Sway or xwayland itself?

It isn't currently possible in sway. #5090 is a proposal to change this. Basically, xwayland scale N would make a best-effort attempt to request X apps render at scale N (sadly not reliable because X) and then pretend all X apps are well behaved at "scale = N". When this matches your configured output scale, X apps will not be rescaled. X apps that support hi-dpi will render correctly, and X apps that do not will render small when scale > 1. Similar to hi-dpi X.org.

It is the best solution imo, and I'm not convinced it would be worth it to add another stopgap solution in the mean time. If that sounds like the behavior you want, I recommend you apply those patches locally.

@emersion
Copy link
Member

Duplicate of #2966 and many other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

No branches or pull requests

3 participants