Xpra: Ticket #990: refactor window geometry code

Split from #907.

There are too many places recording the same information, all with slightly different intents: the X11 window itself (and its parents..), the window model classes, the desktop manager, (and of course: the client)... Also relevant: the ownership information, initial window position and size hints, multiple clients (#41), etc..

This is a blocker for a number of tickets: #846, #988, #881 - and probably many others.

Fri, 23 Oct 2015 15:28:08 GMT - Antoine Martin: status changed

The basics:

The real trickery starts in WindowModel:

And the real ugly parts:

The WM object:

The WorldWindow is just about GTK / X11 focus hell. Not very relevant here.

The DesktopManager is a hidden gtk widget which sits between out server class and the window models, deal with the ownership election business. Each window is also recorded there using a (very confusingly named) model containing the following attributes:

The Source and WindowSource try very hard not to deal with any geometry stuff, for 2 reasons:

The only call made is to get_dimensions so we know the size of the window, and get_image to get the window pixels.

The server is where some of the ugliest code lives:

Maybe we should keep the desktop manager, but have one per client with some shared data structures? (for things like resize counter?) Maybe it should handle OR windows too? (and just delegate those calls so we don't have this ugly if/else mess)

Maybe start by exposing as much as we can via xpra info.

Mon, 26 Oct 2015 11:32:03 GMT - Antoine Martin:

More notes:

Remaining tasks:

Tue, 27 Oct 2015 15:36:32 GMT - Antoine Martin:

More updates, see:

Note: this removes the border attribute from geometry, which we never really used anyway.

Things that will need checking:

Wed, 28 Oct 2015 03:57:44 GMT - Antoine Martin: owner, status changed

Summary: the window geometry code is cleaner and more consistent. It is now handled as a regular property.

The current geometry is always accessible with:

$ xpra info | grep -e "window.*geometry="
window[1].client-geometry=(370, 132, 499, 316)
window[1].geometry=(370, 132, 499, 316)

(the client-geometry is for non-OR windows and shows where the window is mapped for this particular client - which should be the same as the server's geometry)

This the same geometry which is also used with xpra screenshot and with the sync-xvfb option (#988).

These changes need to be tested with most of the window test apps to make sure this has not caused any regressions. Will follow up in #41, #846 and #881.

Wed, 04 Nov 2015 00:40:50 GMT - J. Max Mena: owner changed

Tested a Fedora 21 trunk r11118 Server from a Fedora 20 trunk r11118 Client:

Played around with the python test scripts for a while

Passing back to you for now. Pass it back to us (either afarr or myself) if you need some more testing, as always.

Fri, 13 Nov 2015 11:26:38 GMT - Antoine Martin: status changed; resolution set

Does not seem to have caused any major breakage after all, will follow up in the other geometry related tickets: #723, #772, #994?, #809, #881, #846, #968, #911

Mon, 15 Feb 2016 14:09:08 GMT - Antoine Martin:

Breakage found: #1120.

Wed, 16 Mar 2016 05:39:01 GMT - Antoine Martin:

See also #1121.

Sat, 23 Jan 2021 05:11:47 GMT - migration script:

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