From a2210ba68ad81a7429563bacc256c77e0bef526d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 13 Feb 2017 18:53:54 +0200 Subject: [PATCH] fix #116, remove QueuedConnection --- app/dockcorona.cpp | 3 +++ app/dockview.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/dockcorona.cpp b/app/dockcorona.cpp index 5f832a565..1e884f6eb 100644 --- a/app/dockcorona.cpp +++ b/app/dockcorona.cpp @@ -224,6 +224,9 @@ QRect DockCorona::availableScreenRect(int id) const int DockCorona::primaryScreenId() const { + //this is not the proper way because kwin probably uses a different + //index of screens... + //This needs a lot of testing... return qGuiApp->screens().indexOf(qGuiApp->primaryScreen()); } diff --git a/app/dockview.cpp b/app/dockview.cpp index 236a88165..87e9f5394 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -109,7 +109,7 @@ DockView::~DockView() void DockView::init() { - connect(this, &DockView::screenChanged, this, &DockView::adaptToScreen, Qt::QueuedConnection); + connect(this, &DockView::screenChanged, this, &DockView::adaptToScreen); connect(this, &DockView::screenGeometryChanged, this, &DockView::syncGeometry); connect(this, &QQuickWindow::widthChanged, this, &DockView::widthChanged); connect(this, &QQuickWindow::heightChanged, this, &DockView::heightChanged); @@ -135,7 +135,7 @@ void DockView::init() void DockView::adaptToScreen(QScreen *screen) { - if (!screen || !this->containment() || this->screen() == screen) { + if (!screen) { return; } @@ -249,7 +249,7 @@ void DockView::resizeWindow() setMaximumSize(size); resize(size); } else { - QSize screenSize = screen()->size(); + QSize screenSize = this->screen()->size(); QSize size{screenSize.width(), maxThickness()}; if (m_drawShadows) { @@ -298,7 +298,7 @@ void DockView::updatePosition() switch (location()) { case Plasma::Types::TopEdge: - screenGeometry = screen()->geometry(); + screenGeometry = this->screen()->geometry(); if (m_drawShadows) { position = {screenGeometry.x() + length(screenGeometry.width()), screenGeometry.y()}; @@ -309,7 +309,7 @@ void DockView::updatePosition() break; case Plasma::Types::BottomEdge: - screenGeometry = screen()->geometry(); + screenGeometry = this->screen()->geometry(); if (m_drawShadows) { position = {screenGeometry.x() + length(screenGeometry.width()), @@ -355,7 +355,7 @@ void DockView::updatePosition() inline void DockView::syncGeometry() { - if (!(screen() && this->containment())) + if (!(this->screen() && this->containment())) return; updateEnabledBorders();