Xpra: Ticket #33: if an application changes the screen size on the server via randr - what do we do?

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)

Thu, 25 Sep 2014 04:33:03 GMT - Antoine Martin: owner, status, milestone changed

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...

Fri, 04 Sep 2015 07:57:24 GMT - Antoine Martin:

Some solutions could be implemented after #976

Tue, 12 Jul 2016 16:51:50 GMT - Antoine Martin: milestone changed

Milestone renamed

Sun, 21 Aug 2016 09:55:49 GMT - Antoine Martin: milestone changed

Milestone renamed

Mon, 23 Jan 2017 07:43:26 GMT - Antoine Martin: milestone changed

Sat, 23 Jan 2021 04:43:44 GMT - migration script:

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