xpra icon
Bug tracker and wiki

Opened 8 months ago

Closed 4 months ago

Last modified 4 months ago

#2217 closed task (fixed)

honour window gravity

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 3.0
Component: client Version: 2.4.x
Keywords: Cc:

Description

This should probably be honoured when we center the contents of a window because of a size mismatch.
ie: in the log sample from ticket:2214#comment:2, using window offset values 1,3 would become 0,0 if gravity is NW.

Change History (10)

comment:1 Changed 4 months ago by Antoine Martin

Milestone: 3.04.0
Status: newassigned

In some cases, but not all, we now have a widget representing the "drawing area": see r23305.

When resizing the window, we can honour the gravity when copying the backing contents over to the new one.

This would be easier to test with an env var to override the default window gravity.

Last edited 4 months ago by Antoine Martin (previous) (diff)

comment:2 Changed 4 months ago by Antoine Martin

Updates:

  • r23328 "keep track of the gravity we're supposed to honour, add env var to override the default: XPRA_DEFAULT_GRAVITY
  • r23329 + r23330 + r23331: preparatory refactoring
  • r23332 preserves fbos when resising (#478)

Still TODO: take gravity into account when copying fbo data (harder because of upside-down opengl coordinates!)

comment:3 Changed 4 months ago by Antoine Martin

Mostly done in r23333.
To make it easier to test with client applications that do specify a gravity (ie: xterm), we can now override it with XPRA_OVERRIDE_GRAVITY. (also a client side switch)

One last hard problem is that whilst we're resizing the window, the server may send us window updates for the old window dimensions... Those updates will include absolute paint coordinates that are actually relative to the old window dimensions.
Potential solutions:

  • ignore it (..)
  • send the current server window size with all screen updates
  • send the window resize counter with all screen updates, and use it to derive the window size this was for (meh)

Because of scaling and other paint transformations (delta!), it's not clear where the coordinate adjustment will need to be made.

Still todo: test with desktop scaling, video scaling, etc.

Last edited 4 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 4 months ago by Antoine Martin

Done by exposing the window-size paint option in r23335.
r23336 makes it easier to test, ie:

XPRA_PAINT_DELAY=2000 XPRA_OVERRIDE_GRAVITY=2 python3 /usr/bin/xpra attach

Still TODO:

  • fbo resizing is still slightly off (opengl viewport projection still using old dimensions? re-init first?)
  • make the window-size optional? (meh)
  • test on Intel chipsets.. (may need to clamp negative texture coordinates when downsizing?)

comment:5 Changed 4 months ago by Antoine Martin

Milestone: 4.03.0

Updates:

  • r23338 fixes things by adding a configurable delay - no idea why we need this, looks like something in X / GLX needs to get the message about the new window size before we can present it properly.
  • r23339 makes the new window-size attribute optional, also makes it possible to disable the new FBO resizing code with: XPRA_OPENGL_FBO_RESIZE=0 xpra attach

Only testing left to do.

comment:6 Changed 4 months ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Works well enough on all platforms tested, except macos: #2372 (not necessarily related)
The configurable delay should be replaced: #2373.

comment:7 Changed 4 months ago by Antoine Martin

This broke python2 - gtk2, fixed in r23396.

comment:8 Changed 4 months ago by Antoine Martin

The delayed refresh code needed to be made python2-compatible: r23400.

comment:9 Changed 4 months ago by Antoine Martin

Bug fix + ported to all backends in r23402.

comment:10 Changed 4 months ago by Antoine Martin

Disabled on macos: #2372

Note: See TracTickets for help on using tickets.