It would be nice if we could preserve the workspace that windows are shown on when we disconnect, so that when we re-connect they re-appear at the same coordinates (we're not far off at the moment) and on the same workspace.
This should be do-able by keeping the value of _NET_CURRENT_DESKTOP
for the window shown on the client. Which means having the ability to store properties on the server. This value would not actually be used by the xpra server, just kept for the client.
Or more simply, by using gtk's get_number()
this patch preserves workspace, and potentially other properties that clients can set
The patch above works, but now that we have multi-client support (see #41), how is this meant to work?
Options:
???
Comments welcome.
workspace mapping is preserved as of r1429. Notes about this code:
do_realize
method of gtk.Widget
, just so we can insert our bit of code in the middle of it - which is a bit nasty.
Still TODO:
realize()
method so we do restore the position again.
There is still a few pixels difference between where we want the window to show up and where it actually shows up.. I think that's because of window decorations and such, not going to bother with it for now.
Replying to antoine:
The patch above works, but now that we have multi-client support (see #41), how is this meant to work?
even without multi-client support, how do we handle disconnecting and reconnecting from a different client?
Replying to antoine:
- r1438 *tries* to keep client properties separate by using a (client supplied) uuid
/var/lib/dbus/machine-id will change when the client is rebooted, this seems sub-optimal. What about using /etc/hostname (which returns fqdn is present) or gethostid(3) (which seems to return primary ip address)
If you are re-connecting from a different client, then the workspace (and any other "client properties" against a window) won't be preserved. This is by design. (although this can be changed, I didn't think it would make sense)
AFAIK, the machine-id
files are not re-generated after installation:
The /etc/machine-id file contains the unique machine id of the local system that is set during installation.
debian & ubuntu doesn't seem to have /etc/machine-id. not a biggie.
On debian & ubuntu, the dbus machine-id will be used, this is also meant to be unique (not re-generated).
I've just found out that a number of window managers (or in some cases, versions of the same WM, and probably also different configurations of the same WM..) do not use workspaces but viewports.. And although we can get some sort of information on where the window is (by looking up _NET_DESKTOP_VIEWPORT
on the root window), there is *nothing* we can do to request which viewport the window will be shown on when we create it! (according to the spec, we can switch to that viewport, but not request it for a window...)
Also, this was causing all sorts of bugs, so I've disabled it for now.
much safer and simpler code - which works ok so far
done in r2106 - now works reliably, without any side effects - only a slight flicker as the window is first shown on the current desktop before being moved to the correct one... I have tried sending the message when the window is realized and not yet mapped, but that does not work :(
Note: it would be nice if we could restore it exactly where it was, but we don't do that yet as we do not take into account the window manager's borders... so the window moves down and to the right a little bit each time.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/170