1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

update frameExtents at View::forcedWorkaroundShown

This commit is contained in:
Michail Vourlakos 2020-05-12 10:30:05 +03:00
parent 8525e076f8
commit b6183c526c
2 changed files with 12 additions and 6 deletions

View File

@ -79,8 +79,13 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view)
});
//! Frame Extents
connect(m_latteView, &Latte::View::headThicknessGapChanged , this, &VisibilityManager::on_publishFrameExtents);
connect(m_latteView, &Latte::View::inEditModeChanged , this, &VisibilityManager::publishFrameExtents);
connect(m_latteView, &Latte::View::headThicknessGapChanged, this, &VisibilityManager::on_publishFrameExtents);
connect(m_latteView, &Latte::View::inEditModeChanged, this, [&]() { publishFrameExtents(); });
connect(m_latteView, &Latte::View::forcedShown, this, [&]() {
//resend information to compositor otherwise it is lost from compositor abnormal behavior
const bool forceUpdate{true};
publishFrameExtents(forceUpdate);
});
connect(m_latteView, &Latte::View::screenEdgeMarginEnabledChanged, this, [&]() {
if (!m_latteView->screenEdgeMarginEnabled()) {
@ -118,7 +123,7 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view)
m_timerPublishFrameExtents.setInterval(2000);
m_timerPublishFrameExtents.setSingleShot(true);
connect(&m_timerPublishFrameExtents, &QTimer::timeout, this, &VisibilityManager::publishFrameExtents);
connect(&m_timerPublishFrameExtents, &QTimer::timeout, this, [&]() { publishFrameExtents(); });
restoreConfig();
}
@ -499,10 +504,11 @@ void VisibilityManager::on_publishFrameExtents()
}
}
void VisibilityManager::publishFrameExtents()
void VisibilityManager::publishFrameExtents(bool forceUpdate)
{
if (m_frameExtentsHeadThicknessGap != m_latteView->headThicknessGap()
|| m_frameExtentsLocation != m_latteView->location()) {
|| m_frameExtentsLocation != m_latteView->location()
|| forceUpdate) {
m_frameExtentsHeadThicknessGap = m_latteView->headThicknessGap();
m_frameExtentsLocation = m_latteView->location();

View File

@ -150,7 +150,7 @@ private slots:
void on_hidingIsBlockedChanged();
void on_publishFrameExtents(); //! delayed
void publishFrameExtents(); //! direct
void publishFrameExtents(bool forceUpdate = false); //! direct
//! KWin Edges Support functions
void updateKWinEdgesSupport();