Skip to content
  • Daniel Vrátil's avatar
    Change the way we use XRandR events to reduce amount of X-calls · d7734339
    Daniel Vrátil authored
    Until now we only used the XRandR events to know that a change happened,
    then we went and queries X server for all the data to update our internal
    cache.
    
    This patch changes the behaviour so that we actually take all the
    information available in the change event, and apply them to our cache,
    so that we don't have to perform X-calls to get information we already
    have.
    
    To make full use of the events, XRandRCrtc class is introduced. An XRandrCRTC
    object represents a single CRTC available on current machine. XRandRCrtc
    objects are either "disconnected", or are linked to a specific XRandROutput,
    to which they provide relevant information. Information availabe in
    RRCrtcChangeNotify  and RROutputChangeNotify events are then used to keep
    those up to date.
    
    Since we already have up-to-date CRTC information now, we can also get rid
    of the endless querying for free CRTCs when applying changes.
    
    All in all, this seems to improve the speed in which we are able to react
    to changes and reduces the X stutter caused by excessive queries to X. There
    is still problem in QXcbConnection which handles XCBRandR events in a rather
    ineffective way, causing huge delays and load on X, but that has to be fixed
    in Qt.
    d7734339