xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 5 years ago

Closed 5 years ago

Last modified 3 months ago

#1101 closed enhancement (fixed)

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

Reported by: alas Owned by: alas
Priority: minor Milestone: 0.17
Component: server Version: trunk
Keywords: Cc:


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).

Change History (7)

comment:1 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to alas

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

comment:2 Changed 5 years ago by 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)...

  • --desktop-scaling=auto:600x800:0.7,1080x1920:1,2560x1440:1.2,32000x32000:1.6x1.5 - as expected.
  • --desktop-scaling=auto:600x800:0.7,1080x1920:1,2560x1440:1.2,32000x32000:1.6x1.5 - as expected.

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

  • --desktop-scaling=auto:600x800:0.25,1080x1920:1,2560x1440:1.2,32000x32000:1.6x0.5, for instance, warns me that I'm an idiot (or that I've typo'd ... whatever), though the reaction was unexpected:
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
  • Going on to try scaling adjustments from that "strange"initial setup, shift-alt-+/- worked as expected, but shift-alt-* produced even more weirdness, in the form of a warning and no scaling:
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.)

comment:3 Changed 5 years ago by 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.

comment:4 Changed 5 years ago by alas

Owner: changed from alas to Antoine Martin

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:

  • 1920x1080:1
  • 2560x1440:1.25
  • 3840x2160: 1.5
  • 32000x32000: 5/3

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.

Last edited 5 years ago by Antoine Martin (previous) (diff)

comment:5 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to alas

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.

comment:6 Changed 5 years ago by alas

Resolution: fixed
Status: newclosed

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


comment:7 Changed 3 months ago by migration script

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

Note: See TracTickets for help on using tickets.