update Canvas geometry when editThickness altered

pull/18/head
Michail Vourlakos 5 years ago
parent 9b58dc7083
commit c2df25649e

@ -153,6 +153,10 @@ void Positioner::init()
syncGeometry(); syncGeometry();
}); });
connect(m_view, &Latte::View::editThicknessChanged, this, [&]() {
updateCanvasGeometry(m_lastAvailableScreenRect);
});
connect(m_view, &Latte::View::normalThicknessChanged, this, [&]() { connect(m_view, &Latte::View::normalThicknessChanged, this, [&]() {
if (m_view->behaveAsPlasmaPanel()) { if (m_view->behaveAsPlasmaPanel()) {
syncGeometry(); syncGeometry();
@ -479,11 +483,15 @@ void Positioner::immediateSyncGeometry()
} }
validateTopBottomBorders(availableScreenRect, freeRegion); validateTopBottomBorders(availableScreenRect, freeRegion);
m_lastAvailableScreenRegion = freeRegion;
} else { } else {
m_view->effects()->setForceTopBorder(false); m_view->effects()->setForceTopBorder(false);
m_view->effects()->setForceBottomBorder(false); m_view->effects()->setForceBottomBorder(false);
} }
m_lastAvailableScreenRect = availableScreenRect;
m_view->effects()->updateEnabledBorders(); m_view->effects()->updateEnabledBorders();
resizeWindow(availableScreenRect); resizeWindow(availableScreenRect);
@ -593,6 +601,10 @@ void Positioner::validateTopBottomBorders(QRect availableScreenRect, QRegion ava
void Positioner::updateCanvasGeometry(QRect availableScreenRect) void Positioner::updateCanvasGeometry(QRect availableScreenRect)
{ {
if (availableScreenRect.isEmpty()) {
return;
}
QRect canvas; QRect canvas;
QRect screenGeometry{m_view->screen()->geometry()}; QRect screenGeometry{m_view->screen()->geometry()};
int thickness{m_view->editThickness()}; int thickness{m_view->editThickness()};

@ -165,6 +165,9 @@ private:
QRect m_canvasGeometry; QRect m_canvasGeometry;
//! it is used in order to enforce X11 to never miss window geometry //! it is used in order to enforce X11 to never miss window geometry
QRect m_validGeometry; QRect m_validGeometry;
//! it is used to update geometry calculations without requesting no needed Corona calculations
QRect m_lastAvailableScreenRect;
QRegion m_lastAvailableScreenRegion;
QPointer<Latte::View> m_view; QPointer<Latte::View> m_view;
QPointer<Latte::Corona> m_corona; QPointer<Latte::Corona> m_corona;

Loading…
Cancel
Save