How to support mixed DPI in Xwayland?

Joseph Burt caseorum at gmail.com
Mon Sep 11 07:57:29 UTC 2017


On Mon, Sep 11, 2017 at 9:08 AM, Olivier Fourdan <fourdan at gmail.com> wrote:
> Hi
>
> On 10 September 2017 at 22:25, Joseph Burt <caseorum at gmail.com> wrote:
>>
>>
>> I'm now up to date on the relevant bug reports. Sorry for the spam.
>>
>> What about always running the X server at hardware resolution,
>> limiting the size of lodpi clients on the XWM side, and letting the
>> compositor scale them?
>
>
> That's pretty much what we do already in mutter 3.26 with
> 'frame-monitor-framebuffer' enabled (and weston and kwin already do this as
> well -or so I heard-), but the problem is the X11 clients that can take
> advantage of hiDPI, you don't want to scale them...
>
> When scaling up the LoDPI X11 clients, you need to adjust the advertised
> screen size accordingly, because a LoDPI client configuring its X11 window
> to be, say 300x200 will end up with a surface of size 600x400 once scaled by
> 2 by the compositor when mapped on screen, so in that case the X server
> needs to adjust, i.e. downscale, the screen size advertised to the LoDPI
> clients by the same factor so that a client basing its window size/location
> on the screen size ends up with the expected size/location when mapped on
> the output, that's https://patchwork.freedesktop.org/patch/175578/
>
> But when dealing with HiDPI aware X11 clients, you don't want to scale those
> because they already know better how to render their contents without
> additional scaling, so eventually, these clients need to have access to the
> actual un-scaled screen size, meaning that the screen size as advertised to
> X11 clients actually depends on the client being capable of taking advantage
> of HiDPI...

I'm talking about just setting a different buffer_scale for each X
client's surfaces. As in, for a scale factor of two (ignoring the
fractional scaling issue for the time being, but it would work the
same), that the XWM only allows HiDPI clients to use more than a
quarter of the screen, HiDPI surfaces get a buffer_scale of 2, LoDPI
1. Any fullscreen or modesetting could be handled a little
differently, that might require some lies.
As Ajax pointed out, X clients might not react to root window
reconfiguration, but they do react to the XWM. The XWM has a huge
amount of power over X clients to enforce just about any policy.

Cheers,
Joseph


More information about the wayland-devel mailing list