do not shrink vertical docks/panels on startup

pull/27/head
Michail Vourlakos 3 years ago
parent a5df2865ba
commit fe4e4f8978

@ -564,7 +564,10 @@ void Positioner::immediateSyncGeometry()
freeRegion = latteCorona->availableScreenRegionWithCriteria(fixedScreen, activityid, ignoreModes, ignoreEdges); freeRegion = latteCorona->availableScreenRegionWithCriteria(fixedScreen, activityid, ignoreModes, ignoreEdges);
} }
maximumRect = maximumNormalGeometry(); //! On startup when offscreen use offscreen screen geometry.
//! This way vertical docks and panels are not showing are shrinked that
//! need to be expanded after sliding-in in startup
maximumRect = maximumNormalGeometry(m_inStartup ? availableScreenRect : QRect());
QRegion availableRegion = freeRegion.intersected(maximumRect); QRegion availableRegion = freeRegion.intersected(maximumRect);
availableScreenRect = freeRegion.intersected(maximumRect).boundingRect(); availableScreenRect = freeRegion.intersected(maximumRect).boundingRect();
@ -634,23 +637,25 @@ void Positioner::setCanvasGeometry(const QRect &geometry)
//! this is used mainly from vertical panels in order to //! this is used mainly from vertical panels in order to
//! to get the maximum geometry that can be used from the dock //! to get the maximum geometry that can be used from the dock
//! based on their alignment type and the location dock //! based on their alignment type and the location dock
QRect Positioner::maximumNormalGeometry() QRect Positioner::maximumNormalGeometry(QRect screenGeometry)
{ {
QRect currentScrGeometry = screenGeometry.isEmpty() ? m_view->screen()->geometry() : screenGeometry;
int xPos = 0; int xPos = 0;
int yPos = m_view->screen()->geometry().y();; int yPos = currentScrGeometry.y();;
int maxHeight = m_view->screen()->geometry().height(); int maxHeight = currentScrGeometry.height();
int maxWidth = m_view->maxNormalThickness(); int maxWidth = m_view->maxNormalThickness();
QRect maxGeometry; QRect maxGeometry;
maxGeometry.setRect(0, 0, maxWidth, maxHeight); maxGeometry.setRect(0, 0, maxWidth, maxHeight);
switch (m_view->location()) { switch (m_view->location()) {
case Plasma::Types::LeftEdge: case Plasma::Types::LeftEdge:
xPos = m_view->screen()->geometry().x(); xPos = currentScrGeometry.x();
maxGeometry.setRect(xPos, yPos, maxWidth, maxHeight); maxGeometry.setRect(xPos, yPos, maxWidth, maxHeight);
break; break;
case Plasma::Types::RightEdge: case Plasma::Types::RightEdge:
xPos = m_view->screen()->geometry().right() - maxWidth + 1; xPos = currentScrGeometry.right() - maxWidth + 1;
maxGeometry.setRect(xPos, yPos, maxWidth, maxHeight); maxGeometry.setRect(xPos, yPos, maxWidth, maxHeight);
break; break;

@ -155,7 +155,7 @@ private:
bool isLastHidingRelocationEvent() const; bool isLastHidingRelocationEvent() const;
QRect maximumNormalGeometry(); QRect maximumNormalGeometry(QRect screenGeometry = QRect());
WindowSystem::AbstractWindowInterface::Slide slideLocation(Plasma::Types::Location location); WindowSystem::AbstractWindowInterface::Slide slideLocation(Plasma::Types::Location location);

Loading…
Cancel
Save