Example #1
0
bool RandRDisplay::needsRefresh() const
{
    Time time, config_timestamp;
    time = XRRTimes(m_dpy, m_currentScreenIndex, &config_timestamp);

    qDebug() << "Cache:" << RandR::timestamp << "Server:" << time << "Config:" << config_timestamp;
    return (RandR::timestamp < time);
}
Example #2
0
void RotationDaemon::rotate(int angle)
{
    // XXX: technically this is leaked
    static XRRScreenConfiguration *config = XRRGetScreenInfo(QX11Info::display(), DefaultRootWindow(QX11Info::display()));

    ushort rotation;
    ushort size;
    size = XRRConfigCurrentConfiguration(config, &rotation);

    short rate;
    rate = XRRConfigCurrentRate(config);

    unsigned long timestamp, current_time;
    timestamp = XRRTimes(QX11Info::display(), XDefaultScreen(QX11Info::display()), &current_time);

    qDebug() << "RotationDaemon::rotate(" << angle << ")";
    XRRSetScreenConfigAndRate(QX11Info::display(), config, DefaultRootWindow(QX11Info::display()), size, angle, rate, timestamp);
}