add system window move function for wayland, require qt 5.15 or higher version

This commit is contained in:
xibowen 2022-06-24 10:21:50 +08:00
parent 6f37872830
commit 645a5a0b63
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <xcb/xcb.h>
#include <QApplication>
#include <QWindow>
#include <QDebug>
@ -233,10 +234,15 @@ void WindowManager::mouseMoveEvent(QObject *obj, QMouseEvent *e)
auto widget = qobject_cast<QWidget *>(obj);
auto topLevel = widget->topLevelWidget();
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
topLevel->windowHandle()->startSystemMove();
#else
auto shellSurface = KWayland::Client::ShellSurface::fromWindow(topLevel->windowHandle());
if (!shellSurface)
return;
shellSurface->requestMove(m_seat, m_serial);
#endif
}
return;