[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [latte-dock] app/dock: fix #946, improve kwin screen edges under X11
From: Michail Vourlakos <null () kde ! org>
Date: 2018-03-31 22:37:32
Message-ID: E1f2P7s-0008Dt-UB () code ! kde ! org
[Download RAW message or body]
Git commit fb8063cdee0f0b7ae58f54d62b8124e5900902cf by Michail Vourlakos.
Committed on 31/03/2018 at 22:37.
Pushed by mvourlakos into branch 'master'.
fix #946,improve kwin screen edges under X11
--make sure that the kwin ghost window ends at
the correct geometry at all cases
M +22 -6 app/dock/screenedgeghostwindow.cpp
M +2 -0 app/dock/screenedgeghostwindow.h
https://commits.kde.org/latte-dock/fb8063cdee0f0b7ae58f54d62b8124e5900902cf
diff --git a/app/dock/screenedgeghostwindow.cpp b/app/dock/screenedgeghostwindow.cpp
index 1309d8d..3465f74 100644
--- a/app/dock/screenedgeghostwindow.cpp
+++ b/app/dock/screenedgeghostwindow.cpp
@@ -45,6 +45,11 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(DockView *view) :
| Qt::NoDropShadowWindowHint
| Qt::WindowDoesNotAcceptFocus);
+ connect(this, &QQuickView::xChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
+ connect(this, &QQuickView::yChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
+ connect(this, &QQuickView::widthChanged, this, \
&ScreenEdgeGhostWindow::fixGeometry); + connect(this, &QQuickView::heightChanged, \
this, &ScreenEdgeGhostWindow::fixGeometry); +
connect(m_dockView, &DockView::absGeometryChanged, this, \
&ScreenEdgeGhostWindow::updateGeometry);
connect(m_dockView, &DockView::screenGeometryChanged, this, \
&ScreenEdgeGhostWindow::updateGeometry);
connect(m_dockView, &DockView::locationChanged, this, \
&ScreenEdgeGhostWindow::updateGeometry); @@ -140,13 +145,24 @@ void \
ScreenEdgeGhostWindow::updateGeometry()
newGeometry.setHeight(qMin(m_dockView->absGeometry().height(), \
m_dockView->screenGeometry().height() - 1)); }
- setMinimumSize(newGeometry.size());
- setMaximumSize(newGeometry.size());
- resize(newGeometry.size());
- setPosition(newGeometry.x(), newGeometry.y());
+ m_calculatedGeometry = newGeometry;
- if (m_shellSurface) {
- m_shellSurface->setPosition(newGeometry.topLeft());
+ fixGeometry();
+}
+
+void ScreenEdgeGhostWindow::fixGeometry()
+{
+ if (!m_calculatedGeometry.isEmpty()
+ && (m_calculatedGeometry.x() != x() || m_calculatedGeometry.y() != y()
+ || m_calculatedGeometry.width() != width() || \
m_calculatedGeometry.height() != height())) { + \
setMinimumSize(m_calculatedGeometry.size()); + \
setMaximumSize(m_calculatedGeometry.size()); + \
resize(m_calculatedGeometry.size()); + setPosition(m_calculatedGeometry.x(), \
m_calculatedGeometry.y()); +
+ if (m_shellSurface) {
+ m_shellSurface->setPosition(m_calculatedGeometry.topLeft());
+ }
}
}
diff --git a/app/dock/screenedgeghostwindow.h b/app/dock/screenedgeghostwindow.h
index 0cef795..5403d9d 100644
--- a/app/dock/screenedgeghostwindow.h
+++ b/app/dock/screenedgeghostwindow.h
@@ -76,12 +76,14 @@ protected:
private slots:
void updateGeometry();
+ void fixGeometry();
private:
void setupWaylandIntegration();
private:
bool m_inDelete{false};
+ QRect m_calculatedGeometry;
DockView *m_dockView{nullptr};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic