mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 16:13:56 +02:00
Use startSystemMove/startSystemResize instead of platform code on Wayland with Qt 5.15
This commit is contained in:
parent
7fef7e6315
commit
0536a479f9
1 changed files with 9 additions and 5 deletions
|
@ -628,6 +628,8 @@ bool StartXCBMoveResize(QWindow *window, int edges) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartWaylandMove(QWindow *window) {
|
bool StartWaylandMove(QWindow *window) {
|
||||||
|
// There are startSystemMove on Qt 5.15
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED
|
||||||
if (const auto waylandWindow = static_cast<QWaylandWindow*>(
|
if (const auto waylandWindow = static_cast<QWaylandWindow*>(
|
||||||
window->handle())) {
|
window->handle())) {
|
||||||
if (const auto seat = waylandWindow->display()->lastInputDevice()) {
|
if (const auto seat = waylandWindow->display()->lastInputDevice()) {
|
||||||
|
@ -636,27 +638,29 @@ bool StartWaylandMove(QWindow *window) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartWaylandResize(QWindow *window, Qt::Edges edges) {
|
bool StartWaylandResize(QWindow *window, Qt::Edges edges) {
|
||||||
|
// There are startSystemResize on Qt 5.15
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED
|
||||||
if (const auto waylandWindow = static_cast<QWaylandWindow*>(
|
if (const auto waylandWindow = static_cast<QWaylandWindow*>(
|
||||||
window->handle())) {
|
window->handle())) {
|
||||||
if (const auto seat = waylandWindow->display()->lastInputDevice()) {
|
if (const auto seat = waylandWindow->display()->lastInputDevice()) {
|
||||||
if (const auto shellSurface = waylandWindow->shellSurface()) {
|
if (const auto shellSurface = waylandWindow->shellSurface()) {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) || defined DESKTOP_APP_QT_PATCHED
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||||
return shellSurface->resize(seat, edges);
|
|
||||||
#elif QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) || defined DESKTOP_APP_QT_PATCHED // Qt >= 5.15 || DESKTOP_APP_QT_PATCHED
|
|
||||||
shellSurface->resize(seat, edges);
|
shellSurface->resize(seat, edges);
|
||||||
return true;
|
return true;
|
||||||
#else // Qt >= 5.13 || DESKTOP_APP_QT_PATCHED
|
#else // Qt >= 5.13
|
||||||
shellSurface->resize(seat, WlResizeFromEdges(edges));
|
shellSurface->resize(seat, WlResizeFromEdges(edges));
|
||||||
return true;
|
return true;
|
||||||
#endif // Qt < 5.13 && !DESKTOP_APP_QT_PATCHED
|
#endif // Qt < 5.13
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue