Ejemplo n.º 1
0
Application::Application()
    : m_application(NULL)
    , m_sticky(false)
    , m_has_visible_window(false)
    , m_progress(0), m_progressBarVisible(false)
    , m_counter(0), m_counterVisible(false)
    , m_emblem(QString()), m_emblemVisible(false)
    , m_forceUrgent(false)
    , m_previousActiveScreen(-1)
    , m_dynamicQuicklistServiceWatcher(NULL)
{
    m_launching_timer.setSingleShot(true);
    m_launching_timer.setInterval(8000);
    QObject::connect(&m_launching_timer, SIGNAL(timeout()), this, SLOT(onLaunchingTimeouted()));

    // Accumulate geometry changes during 50 msec
    // This is done because geometry-changed happens VERY often and doing the calculation
    // all the time just drags down your CPU for no reason
    // Instead what we do is send the windowGeometryChanged 50 msec after a geometry-changed
    // ignoring the geometry-changed that happen in that period, so at most we do
    // the calculation each 50ms instead of every single pixel move
    m_geometryChangedTimer.setSingleShot(true);
    m_geometryChangedTimer.setInterval(50);
    connect(&m_geometryChangedTimer, SIGNAL(timeout()), this, SIGNAL(windowGeometryChanged()));
    connect(&m_geometryChangedTimer, SIGNAL(timeout()), this, SLOT(announceActiveScreenChangedIfNeeded()));

    connect(desktopFileWatcher(), SIGNAL(fileChanged(const QString&)), SLOT(onDesktopFileChanged(const QString&)));
}
Ejemplo n.º 2
0
void MainWindow::resizeEvent(QResizeEvent* event) {
    emit windowGeometryChanged(QRect(QPoint(x(), y()), event->size()));
    QMainWindow::resizeEvent(event);
}
Ejemplo n.º 3
0
void MainWindow::moveEvent(QMoveEvent* event) {
    emit windowGeometryChanged(QRect(event->pos(), size()));
    QMainWindow::moveEvent(event);
}
Ejemplo n.º 4
0
void MainWindow::resizeEvent(QResizeEvent* event) {
    emit windowGeometryChanged(QRect(QPoint(geometry().x(), geometry().y()), size()));  // Geometry excluding the window frame.
    QMainWindow::resizeEvent(event);
}