Xpra: Ticket #2464: Window size calculations wrong when GDK_SCALE >= 2

GDK window scaling confuses xpra's window size calculations. Suppose I run this command:

GDK_SCALE=2 xpra start ssh/mymachine --opengl=on --daemon=no --desktop-scaling=0 --video-scaling=0 --start='xcalc -geometry 200x200'

As far as mymachine is concerned, it's created a 200x200 window. But on my local machine, I get a 400x400 window. In OpenGL mode, xpra renders a 200x200 square in the lower-left corner of that 400x400 window with the rest of the window containing random pre-existing content from graphics memory. In non-OpenGL mode, xpra just scales up the 200x200 feed from the server to the 400x400 size of the client window.

I'd expect xpra to exempt itself from GDK scaling and render windows at exactly the size indicated by the remote machine, modulo xpra's own scaling options.

Sun, 27 Oct 2019 03:59:31 GMT - Antoine Martin: status changed; resolution set

Thanks, fixed in r24281.

See also #2438.

Sun, 27 Oct 2019 04:13:39 GMT - dancol: status changed; resolution deleted

That's not quite the right fix. The problem isn't the environment variable itself: it's the GDK scaling factor it sets. You can also get a scaling factor of two on a regular high-DPI screen. Xpra should probably explicitly assign this variable to "1" or otherwise ignore the GDK scaling factor. It should also avoid leaking the variable (if it sets it) to children.

Sun, 27 Oct 2019 04:15:53 GMT - dancol:

Yeah, #2438 seems like the root cause.

Sun, 27 Oct 2019 07:36:54 GMT - Antoine Martin: owner, status changed

@dancol: what problems are you seeing with this fix? Are you running r24133 or later with r24281 applied on top? How can I reproduce?

It should also avoid leaking the variable (if it sets it) to children.

That's not so easy.

Tue, 26 Nov 2019 11:48:02 GMT - Antoine Martin: status changed; resolution set

unsetting GDK_SCALE is not enough: #2492

Sat, 23 Jan 2021 05:51:58 GMT - migration script:

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