forked from openkylin/qt5-ukui-platformtheme
add system window move function for wayland, require qt 5.15 or higher version
This commit is contained in:
parent
6f37872830
commit
645a5a0b63
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue