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

fix hiding of panels with mask technique

This commit is contained in:
Michail Vourlakos 2020-10-27 19:12:48 +02:00
parent 043c65e36c
commit c7d11c443e
4 changed files with 12 additions and 7 deletions

View File

@ -428,7 +428,11 @@ void Effects::updateMask()
{
if (KWindowSystem::compositingActive()) {
if (m_view->behaveAsPlasmaPanel()) {
m_view->setMask(QRect());
if (!m_view->visibility()->isHidden()) {
m_view->setMask(QRect());
} else {
m_view->setMask(VisibilityManager::ISHIDDENMASK);
}
} else {
m_view->setMask(maskCombinedRegion());
}

View File

@ -21,6 +21,7 @@
// local
#include "../view.h"
#include "../visibilitymanager.h"
// Qt
#include <QDebug>
@ -269,9 +270,7 @@ void SubWindow::hideWithMask()
qDebug() << m_debugType + " :: MASK HIDE...";
}
//! old values: 0,0,1,1 were blocking the top-left corner of the window
QRect maskGeometry{-2, 0, 1, 1};
setMask(maskGeometry);
setMask(VisibilityManager::ISHIDDENMASK);
//! repaint in order to update mask immediately
setColor(m_hideColor);

View File

@ -57,6 +57,7 @@ namespace Latte {
namespace ViewPart {
//! BEGIN: VisiblityManager implementation
const QRect VisibilityManager::ISHIDDENMASK = QRect(-1, -1, 1, 1);
VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view)
: QObject(view)
@ -642,14 +643,13 @@ void VisibilityManager::updateGhostWindowState()
void VisibilityManager::hide()
{
m_lastMask = m_latteView->mask();
m_latteView->setMask(QRect(-1, -1, 1, 1));
m_latteView->setMask(ISHIDDENMASK);
}
void VisibilityManager::show()
{
if (m_latteView->mask() == QRect(-1, -1 , 1, 1)) {
if (m_latteView->mask() == ISHIDDENMASK) {
m_latteView->setMask(m_lastMask);
}
}

View File

@ -70,6 +70,8 @@ class VisibilityManager : public QObject
Q_PROPERTY(int timerHide READ timerHide WRITE setTimerHide NOTIFY timerHideChanged)
public:
static const QRect ISHIDDENMASK;
explicit VisibilityManager(PlasmaQuick::ContainmentView *view);
virtual ~VisibilityManager();