diff options
Diffstat (limited to 'src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp')
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp index 61a865cb2..b691ee747 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp @@ -73,18 +73,19 @@ QWaylandXdgSurfaceV5::~QWaylandXdgSurfaceV5() delete m_extendedWindow; } -void QWaylandXdgSurfaceV5::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) +QtWayland::xdg_surface_v5::resize_edge QWaylandXdgSurfaceV5::convertToResizeEdges(Qt::Edges edges) { - // May need some conversion if types get incompatibles, ATM they're identical - enum resize_edge const * const arg = reinterpret_cast<enum resize_edge const *>(&edges); - resize(inputDevice, *arg); + return static_cast<enum resize_edge>( + ((edges & Qt::TopEdge) ? resize_edge_top : 0) + | ((edges & Qt::BottomEdge) ? resize_edge_bottom : 0) + | ((edges & Qt::LeftEdge) ? resize_edge_left : 0) + | ((edges & Qt::RightEdge) ? resize_edge_right : 0)); } -void QWaylandXdgSurfaceV5::resize(QWaylandInputDevice *inputDevice, enum resize_edge edges) +void QWaylandXdgSurfaceV5::resize(QWaylandInputDevice *inputDevice, Qt::Edges edges) { - resize(inputDevice->wl_seat(), - inputDevice->serial(), - edges); + resize_edge resizeEdges = convertToResizeEdges(edges); + resize(inputDevice->wl_seat(), inputDevice->serial(), resizeEdges); } bool QWaylandXdgSurfaceV5::move(QWaylandInputDevice *inputDevice) |