xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 11 years ago

Last modified 16 months ago

#33 assigned task

if an application changes the screen size on the server via randr - what do we do?

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: future
Component: server Version:
Keywords: Cc:


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)

Change History (6)

comment:1 Changed 8 years ago by Antoine Martin

Milestone: future1.0
Owner: changed from Antoine Martin to Antoine Martin
Status: newassigned

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

comment:2 Changed 7 years ago by Antoine Martin

Some solutions could be implemented after #976

comment:3 Changed 6 years ago by Antoine Martin

Milestone: 1.01.1

Milestone renamed

comment:4 Changed 6 years ago by Antoine Martin

Milestone: 1.12.0

Milestone renamed

comment:5 Changed 5 years ago by Antoine Martin

Milestone: 2.0future

comment:6 Changed 16 months ago by migration script

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

Note: See TracTickets for help on using tickets.