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); }
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()), ¤t_time); qDebug() << "RotationDaemon::rotate(" << angle << ")"; XRRSetScreenConfigAndRate(QX11Info::display(), config, DefaultRootWindow(QX11Info::display()), size, angle, rate, timestamp); }