event compress restore after location change

now the panel position is correct after location change, and flickers less
This commit is contained in:
Marco Martin 2014-02-18 16:54:05 +01:00
parent 553055e6d3
commit fa8ed3668b
2 changed files with 17 additions and 4 deletions

View File

@ -58,21 +58,33 @@ PanelView::PanelView(ShellCorona *corona, QWindow *parent)
themeChanged();
connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelView::themeChanged);
m_positionPaneltimer.setSingleShot(true);
m_positionPaneltimer.setInterval(150);
connect(&m_positionPaneltimer, &QTimer::timeout,
this, [=] () {
restore();
positionPanel();
});
//Screen management
connect(this, &QWindow::screenChanged,
this, &PanelView::positionPanel);
connect(screen(), &QScreen::geometryChanged,
this, &PanelView::positionPanel);
connect(this, &PlasmaQuickView::locationChanged,
this, &PanelView::positionPanel);
&m_positionPaneltimer, [=] () {
m_positionPaneltimer.start();
});
connect(this, &PlasmaQuickView::containmentChanged,
this, &PanelView::positionPanel);
connect(this, &PlasmaQuickView::containmentChanged,
this, [=] () {
restore();
positionPanel();
m_positionPaneltimer.start();
});
if (!m_corona->package().isValid()) {
qWarning() << "Invalid home screen package";
}
@ -382,7 +394,6 @@ void PanelView::positionPanel()
}
m_strutsTimer->stop();
m_strutsTimer->start(STRUTSTIMERDELAY);
setMinimumSize(QSize(0, 0));
setMaximumSize(screen()->size());

View File

@ -24,6 +24,7 @@
#include "panelconfigview.h"
#include <QtCore/qpointer.h>
#include <Plasma/Theme>
#include <QTimer>
class ShellCorona;
@ -113,6 +114,7 @@ private:
QTimer *m_strutsTimer;
VisibilityMode m_visibilityMode;
Plasma::Theme m_theme;
QTimer m_positionPaneltimer;
static const int STRUTSTIMERDELAY = 200;
};