r220 added the ability to detect screen size changes on the client so the server can resize on demand.
We could quite easily implement similar code on the server to catch changes to the screen geometry (but not the ones we requested ourselves obviously). The question is: what do we do then? Forcing the screen to change back is probably wrong - but then so is keeping a virtual screen with the wrong dimensions... maybe we can tell the user with the new notifications? Not sure what to do here!
As for the detection code, we can do this either with the same pygtk code (see r220) or with native X11 code:
cdef extern from "X11/extensions/randr.h": unsigned int RRScreenChangeNotifyMask cdef extern from "X11/extensions/Xrandr.h": ctypedef CARD16 SubpixelOrder ctypedef struct XRRScreenChangeNotifyEvent: int type unsigned long serial Bool send_event Display *display Window window Window root Time timestamp Time config_timestamp SizeID size_index SubpixelOrder subpixel_order Rotation rotation int width int height int mwidth int mheight void XRRSelectInput(Display *dpy, Window window, int mask) def selectXRREvents(pywindow, on): cdef Display * display cdef Window window display = get_xdisplay_for(gtk.gdk.display_get_default()) window = get_xwindow(gtk.gdk.get_default_root_window()) mask = RRScreenChangeNotifyMask XRRSelectInput(display, window, mask)
A better option, as done by steamos: X and SteamOS would be to intercept the RandR
calls with another LD_PRELOAD
hook, do nothing but record the desired screen size and return it to the application should it query it again (via randr or xinerama...) and tell xpra to use this exact size only as source and scale it appropriately on the client side.
Not sure how this is going to play with DPI, GTK and other things...
Some solutions could be implemented after #976
Milestone renamed
Milestone renamed
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/33