start struts timer in resizeEvent

Summary:
starting the stuts timer in resize/move events means we don't have to
litter it across any code that might move/resize the panel, also we get
event compression for free (so could probably remove the timer in
future).
Much neater and fixes a bug.

BUG: 362887

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1584
wilder-5.14
David Edmundson 10 years ago
parent 941bfdb2eb
commit 6abc546d30
  1. 9
      shell/panelview.cpp

@ -196,7 +196,6 @@ void PanelView::setOffset(int offset)
positionPanel();
emit offsetChanged();
m_corona->requestApplicationConfigSync();
m_strutsTimer.start(STRUTSTIMERDELAY);
emit m_corona->availableScreenRegionChanged();
}
@ -357,9 +356,6 @@ void PanelView::positionPanel()
slideLocation = KWindowEffects::BottomEdge;
break;
}
m_strutsTimer.stop();
m_strutsTimer.start(STRUTSTIMERDELAY);
const QPoint pos = geometryByDistance(m_distance).topLeft();
setPosition(pos);
if (m_shellSurface) {
@ -624,18 +620,20 @@ void PanelView::setAutoHideEnabled(bool enabled)
void PanelView::resizeEvent(QResizeEvent *ev)
{
updateMask();
//don't setGeometry() to meke really sure we aren't doing a resize loop
//don't setGeometry() to make really sure we aren't doing a resize loop
const QPoint pos = geometryByDistance(m_distance).topLeft();
setPosition(pos);
if (m_shellSurface) {
m_shellSurface->setPosition(pos);
}
m_strutsTimer.start(STRUTSTIMERDELAY);
PlasmaQuick::ContainmentView::resizeEvent(ev);
}
void PanelView::moveEvent(QMoveEvent *ev)
{
updateMask();
m_strutsTimer.start(STRUTSTIMERDELAY);
PlasmaQuick::ContainmentView::moveEvent(ev);
}
@ -874,6 +872,7 @@ void PanelView::updateStruts()
return;
}
NETExtendedStrut strut;
if (m_visibilityMode == NormalPanel) {

Loading…
Cancel
Save