Xpra: Ticket #1101: Would it be possible to have a desktop-scaling flag to change the value settings for desktop-size-determined defaults?

From what I've noticed, it looks like desktop-scaling defaults to a value of 1.5 for client desktops between 1080p and 4K, and to a value of 2 for desktops of greater than 4K total dimensions.

Would it be possible to enable a connection flag (and possibly control channel or dbus-channel support) to set those desktop-size determined scaling values to custom values (the --desktop-scaling= flag works as expected, but doesn't allow for different values based on the client's desktop size... looking for something similar, but including the feature of basing the scaling value on the client's desktop size).

Thu, 28 Jan 2016 06:15:23 GMT - Antoine Martin: owner changed

It would have been better if we had come up with better values during the work #976. If you do find better values to use, please post them here so I can update the default settings.

In the meantime, it was easy enough to implement (though I didn't bother updating the man page with this - don't let that stop you from doing it).

You can now specify the thresholds like so: WIDTHxHEIGHT:X_SCALINGxYSCALING or simply: WIDTH:HEIGHT:SCALING as a comma separated list:

$ xpra attach --desktop-scaling=auto:1200x1000:1.5,2000x1200:2,32000x32000:2.5x3

This will select 1.5x for screens up to 2000x1200, 2x for screens up to 3000,2000 and 2.5x3 above that. (32000 is the theoretical maximum display size we support)

Turning on the scaling debug flag should confirm this:

parsed desktop-scaling auto limits: [(1200, 1000, 1.5, 1.5)]
parsed desktop-scaling auto limits: [(1200, 1000, 1.5, 1.5), (2000, 1200, 2.0, 2.0)]
parsed desktop-scaling auto limits: [(1200, 1000, 1.5, 1.5), (2000, 1200, 2.0, 2.0), (32000, 32000, 2.5, 3.0)]
matched 1920x1080 with limits [(1200, 1000, 1.5, 1.5), (2000, 1200, 2.0, 2.0), (32000, 32000, 2.5, 3.0)]: 2.0x2.0

Fri, 29 Jan 2016 22:32:16 GMT - alas:

Thanks for the quick turnaround!

Behaves very well with sane values (testing with 0.17.0 r11776 win32 client against 0.17.0 r11778 fedora 23 server)...

Even passing in strange values, there are warnings to explain strange behavior...

2016-01-29 14:08:54,217 Warning: adjusting scaling to accomodate server
2016-01-29 14:08:54,233  server desktop size is 8192x4096
2016-01-29 14:08:54,233  using scaling factor 0.625 x 0.625
2016-01-29 14:08:54,233 Server's virtual screen is too small
2016-01-29 14:08:54,233  server: 3200x4096 vs client: 8192x3456
2016-01-29 14:08:54,233  you may see strange behavior,
2016-01-29 14:08:54,233  please see http://xpra.org/trac/wiki/Xdummy#Configuration
2016-01-29 14:12:20,065 Warning: cannot scale by 160% x 50% or lower
2016-01-29 14:12:20,065  the scaled client screen 5120 x 2160 -> 3200 x 4320
2016-01-29 14:12:20,065  would overflow the server's screen: 8192 x 4096

All in all, everything looks good.

I'll try some options on a number of desktop sizes and post (hopefully shortly) a suggested alternate set of defaults. (In the meantime, this ticket could be closed if you'd like, since it seems to be working as hoped first try.)

Fri, 29 Jan 2016 22:48:03 GMT - Antoine Martin:

I'm not going to worry too much about corner cases with invalid values specified, as long as we show a warning for it.

r11791 reduces the amount of scaling (and also makes the limits specified inclusive so 2560x1440:1.2 will use 1.2 up to and including 2560x1440). I think this the new scaling values should be backported to v0.16.x as the xterms are just huge when I plug in a second monitor.

Suggestions for better defaults welcome, otherwise please just close this ticket.

Thu, 04 Feb 2016 23:10:56 GMT - alas: owner changed

Ahhh... I had meant to post about the including value, but you found it before I had a chance.

As for the defaults... did some limited testing, and my best guess would be something along the lines of:

I would also consider something like 800x600:.8, but who has a display so small these days?

One last note: if I forget the syntax and set 1440x2560:x,32000x32000:y, connecting with a 2560x1440 display client will lead to a scaling of y ... though I'm not sure if that sort of foolishness should be supported, or even necessarily checked for and warned about.

One laster note: testing with a win32 0.17.0 r11776 client against a fedora 23 0.17.0 r11814 server, when I set a value of 32000x32000:5/3, the client gives me a Warning: failed to parse limit string '32000x32000:5/3: invalid literal for float(): 5/3. Seemed to work with an older osx client though, which leads to some head scratching on my part.

Re-assigning to you, should be about close ready - and thanks again.

Thu, 04 Feb 2016 23:55:32 GMT - Antoine Martin: owner changed

r11845 + r11846 makes the scaling even less aggressive (166% up to 8K, 200% above that)

r11847 applies all this to v0.16.x

I'm not sure if that sort of foolishness should be supported

Such foolishness is now supported as of r11850. We also default to no scaling (1,1) if none of the scaling dimensions given matches he monitor. (so you don't really need to specify 1920x1080:1x1 - this is now assumed) We use the number of pixels in the dimension given, rather than individual dimensions. So 1000x1000 will match my 1366x768 display (which has less than 1 Megapixel in total).

when I set a value of 32000x32000:5/3...

This syntax is invalid unless it is prefixed with: auto:32000x32000:5/3... r11849 will make that clearer (using more helpful error message)

If that's all good, please close.

Fri, 05 Feb 2016 22:17:19 GMT - alas: status changed; resolution set

Looks good to me - defaults in 0.16.x and support for my not remembering monitor resolution syntax both!


Sat, 23 Jan 2021 05:15:00 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1101