>> I also cannot imagine this to work due to the fact how X11 works. There is just no mapping from window to screen. No window can know on which screen it is. Not even KWin knows that as the window manager (screen is not a constant property, but evaluated every time it is accessed, it's based on the distance to closest screen). Especially for overlapping windows it's very difficult to try to get to which screen it belongs. It gets even more complicated when things like panning and overlapping screens get into it. So I wouldn't trust this thing in Qt to work due to the pain we have in KWin especially with these problems.
> First, the fact that the two monitors have differing DPI means each monitor needs different settings to account for that. xrandr allows setting the DPI via --dpi, but this applies globally to all monitors. I dealt with this by setting the global DPI to that of the highest DPI monitor, and then used --scale to adjust the lower DPI monitor.
> Since xorg 1.20 the patch to resolve that should be included, so you can try your configuration without panning.
> I had a semi-working setup with little trouble, but it involved restarting X when I wanted to switch between dual and single monitors. This worked, but obviously was inconvenient. I wanted a solution that would work without restarts.
> Most of these options are similar to the first command's. The main difference is disabling the laptop monitor with --output eDP-1 --off.
> Note 3840x2160 comes from 1920*2 x 1080*2.
> You might wonder why I set high DPI and scale the lower DPI monitor here. Wouldn't it be simpler to set a lower DPI and use the monitor's native resolution? That's possible, but since I've configured other things (such as my X terminal fonts) to a size suitable for a high DPI screen, I'd have to adjust settings elsewhere. Keeping the DPI the same and continuing to scale allows me to avoid that. Since I'm scaling, I need to configure a large screen and set panning for the same reasons as before.
>         --dpi 276 sets the DPI to 276.
>         --fb 7040x3960 creates one screen with resolution 7040x3960. This is the combined resolution of the two monitors. The high DPI monitor has 3200x1800 resolution. The lower DPI monitor has 1920x1080 resolution, but I double it as I scale it by 2 (see below). Combine these like so: 3200+1920*2 x 1800+1080*2 = 7040x3960. Both monitors share this screen.
>         --mode 3200x1800 says to use resolution 3200x1800. This is the default, but specifying it is necessary if the monitor is disabled (as it is when using the external monitor by itself) as it enables the monitor.
>         --scale 2x2 is similar to zooming out. This is necessary as we set the DPI globally to that of the high DPI monitor.
>         --pos positions it to the right of the laptop monitor.
>         --panning allows our pointer to access the whole area.