|
|
@ -24,6 +24,7 @@
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QSurfaceFormat>
|
|
|
|
#include <QSurfaceFormat>
|
|
|
|
#include <QQuickView>
|
|
|
|
#include <QQuickView>
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
|
|
|
|
#include <KWayland/Client/plasmashell.h>
|
|
|
|
#include <KWayland/Client/plasmashell.h>
|
|
|
|
#include <KWayland/Client/surface.h>
|
|
|
|
#include <KWayland/Client/surface.h>
|
|
|
@ -45,16 +46,21 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(DockView *view) :
|
|
|
|
| Qt::NoDropShadowWindowHint
|
|
|
|
| Qt::NoDropShadowWindowHint
|
|
|
|
| Qt::WindowDoesNotAcceptFocus);
|
|
|
|
| Qt::WindowDoesNotAcceptFocus);
|
|
|
|
|
|
|
|
|
|
|
|
connect(this, &QQuickView::xChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
|
|
|
|
m_fixGeometryTimer.setSingleShot(true);
|
|
|
|
connect(this, &QQuickView::yChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
|
|
|
|
m_fixGeometryTimer.setInterval(500);
|
|
|
|
connect(this, &QQuickView::widthChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
|
|
|
|
connect(&m_fixGeometryTimer, &QTimer::timeout, this, &ScreenEdgeGhostWindow::fixGeometry);
|
|
|
|
connect(this, &QQuickView::heightChanged, this, &ScreenEdgeGhostWindow::fixGeometry);
|
|
|
|
|
|
|
|
|
|
|
|
connect(this, &QQuickView::xChanged, this, &ScreenEdgeGhostWindow::startGeometryTimer);
|
|
|
|
|
|
|
|
connect(this, &QQuickView::yChanged, this, &ScreenEdgeGhostWindow::startGeometryTimer);
|
|
|
|
|
|
|
|
connect(this, &QQuickView::widthChanged, this, &ScreenEdgeGhostWindow::startGeometryTimer);
|
|
|
|
|
|
|
|
connect(this, &QQuickView::heightChanged, this, &ScreenEdgeGhostWindow::startGeometryTimer);
|
|
|
|
|
|
|
|
|
|
|
|
connect(m_dockView, &DockView::absGeometryChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &DockView::absGeometryChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &DockView::screenGeometryChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &DockView::screenGeometryChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &DockView::locationChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &DockView::locationChanged, this, &ScreenEdgeGhostWindow::updateGeometry);
|
|
|
|
connect(m_dockView, &QQuickView::screenChanged, this, [this]() {
|
|
|
|
connect(m_dockView, &QQuickView::screenChanged, this, [this]() {
|
|
|
|
setScreen(m_dockView->screen());
|
|
|
|
setScreen(m_dockView->screen());
|
|
|
|
|
|
|
|
updateGeometry();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -169,6 +175,11 @@ void ScreenEdgeGhostWindow::fixGeometry()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenEdgeGhostWindow::startGeometryTimer()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_fixGeometryTimer.start();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenEdgeGhostWindow::setupWaylandIntegration()
|
|
|
|
void ScreenEdgeGhostWindow::setupWaylandIntegration()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_dockView || !m_dockView->containment()) {
|
|
|
|
if (m_shellSurface || !KWindowSystem::isPlatformWayland() || !m_dockView || !m_dockView->containment()) {
|
|
|
|