fix crash when changing to default session

--this was a rare crash when changing to default
session from the alternative one through the context
menu of the Tasks plasmoid there was a crash sometimes
pull/1/head
Michail Vourlakos 8 years ago
parent 4b8f3a4b33
commit 9e74ce95a2

@ -130,6 +130,9 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindo
DockView::~DockView() DockView::~DockView()
{ {
disconnect(corona(), &Plasma::Corona::availableScreenRectChanged, this, &DockView::availableScreenRectChanged);
m_inDelete = true;
m_screenSyncTimer.stop(); m_screenSyncTimer.stop();
qDebug() << "dock view deleting..."; qDebug() << "dock view deleting...";
@ -169,10 +172,9 @@ void DockView::init()
connect(this, &QQuickWindow::widthChanged, this, &DockView::updateAbsDockGeometry); connect(this, &QQuickWindow::widthChanged, this, &DockView::updateAbsDockGeometry);
connect(this, &QQuickWindow::heightChanged, this, &DockView::heightChanged); connect(this, &QQuickWindow::heightChanged, this, &DockView::heightChanged);
connect(this, &QQuickWindow::heightChanged, this, &DockView::updateAbsDockGeometry); connect(this, &QQuickWindow::heightChanged, this, &DockView::updateAbsDockGeometry);
connect(corona(), &Plasma::Corona::availableScreenRectChanged, this, [&]() {
if (formFactor() == Plasma::Types::Vertical) connect(corona(), &Plasma::Corona::availableScreenRectChanged, this, &DockView::availableScreenRectChanged);
syncGeometry();
});
connect(this, &DockView::behaveAsPlasmaPanelChanged, this, &DockView::syncGeometry); connect(this, &DockView::behaveAsPlasmaPanelChanged, this, &DockView::syncGeometry);
connect(this, &DockView::drawShadowsChanged, this, &DockView::syncGeometry); connect(this, &DockView::drawShadowsChanged, this, &DockView::syncGeometry);
connect(this, &DockView::maxLengthChanged, this, &DockView::syncGeometry); connect(this, &DockView::maxLengthChanged, this, &DockView::syncGeometry);
@ -219,6 +221,12 @@ void DockView::init()
qDebug() << "SOURCE:" << source(); qDebug() << "SOURCE:" << source();
} }
void DockView::availableScreenRectChanged()
{
if (formFactor() == Plasma::Types::Vertical)
syncGeometry();
}
void DockView::setupWaylandIntegration() void DockView::setupWaylandIntegration()
{ {
using namespace KWayland::Client; using namespace KWayland::Client;

@ -232,6 +232,7 @@ signals:
void absGeometryChanged(const QRect &geometry); void absGeometryChanged(const QRect &geometry);
private slots: private slots:
void availableScreenRectChanged();
void menuAboutToHide(); void menuAboutToHide();
void statusChanged(Plasma::Types::ItemStatus); void statusChanged(Plasma::Types::ItemStatus);
void screenChanged(QScreen *screen); void screenChanged(QScreen *screen);
@ -258,6 +259,7 @@ private:
bool m_dockWinBehavior{false}; bool m_dockWinBehavior{false};
bool m_drawShadows{true}; bool m_drawShadows{true};
bool m_drawEffects{false}; bool m_drawEffects{false};
bool m_inDelete{false};
bool m_onPrimary{true}; bool m_onPrimary{true};
int m_dockTransparency{100}; int m_dockTransparency{100};
int m_maxThickness{24}; int m_maxThickness{24};

Loading…
Cancel
Save