diff options
Diffstat (limited to 'examples/wayland/qwindow-compositor/compositor.cpp')
-rw-r--r-- | examples/wayland/qwindow-compositor/compositor.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp index d9f850424..9d608d404 100644 --- a/examples/wayland/qwindow-compositor/compositor.cpp +++ b/examples/wayland/qwindow-compositor/compositor.cpp @@ -44,7 +44,7 @@ #include <QKeyEvent> #include <QTouchEvent> -#include <QtWaylandCompositor/QWaylandXdgShell> +#include <QtWaylandCompositor/QWaylandXdgShellV5> #include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/qwaylandseat.h> #include <QtWaylandCompositor/qwaylanddrag.h> @@ -145,11 +145,11 @@ Compositor::Compositor(QWindow *window) : QWaylandCompositor() , m_window(window) , m_wlShell(new QWaylandWlShell(this)) - , m_xdgShell(new QWaylandXdgShell(this)) + , m_xdgShell(new QWaylandXdgShellV5(this)) { connect(m_wlShell, &QWaylandWlShell::wlShellSurfaceCreated, this, &Compositor::onWlShellSurfaceCreated); - connect(m_xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, this, &Compositor::onXdgSurfaceCreated); - connect(m_xdgShell, &QWaylandXdgShell::xdgPopupRequested, this, &Compositor::onXdgPopupRequested); + connect(m_xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, this, &Compositor::onXdgSurfaceCreated); + connect(m_xdgShell, &QWaylandXdgShellV5::xdgPopupRequested, this, &Compositor::onXdgPopupRequested); } Compositor::~Compositor() @@ -189,8 +189,8 @@ void Compositor::surfaceHasContentChanged() QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); if (surface->hasContent()) { if (surface->role() == QWaylandWlShellSurface::role() - || surface->role() == QWaylandXdgSurface::role() - || surface->role() == QWaylandXdgPopup::role()) { + || surface->role() == QWaylandXdgSurfaceV5::role() + || surface->role() == QWaylandXdgPopupV5::role()) { defaultSeat()->setKeyboardFocus(surface); } } else if (popupActive()) { @@ -237,19 +237,19 @@ void Compositor::onWlShellSurfaceCreated(QWaylandWlShellSurface *wlShellSurface) view->m_wlShellSurface = wlShellSurface; } -void Compositor::onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface) +void Compositor::onXdgSurfaceCreated(QWaylandXdgSurfaceV5 *xdgSurface) { - connect(xdgSurface, &QWaylandXdgSurface::startMove, this, &Compositor::onStartMove); - connect(xdgSurface, &QWaylandXdgSurface::startResize, this, &Compositor::onXdgStartResize); + connect(xdgSurface, &QWaylandXdgSurfaceV5::startMove, this, &Compositor::onStartMove); + connect(xdgSurface, &QWaylandXdgSurfaceV5::startResize, this, &Compositor::onXdgStartResize); View *view = findView(xdgSurface->surface()); Q_ASSERT(view); view->m_xdgSurface = xdgSurface; - connect(xdgSurface, &QWaylandXdgSurface::setMaximized, view, &View::onXdgSetMaximized); - connect(xdgSurface, &QWaylandXdgSurface::setFullscreen, view, &View::onXdgSetFullscreen); - connect(xdgSurface, &QWaylandXdgSurface::unsetMaximized, view, &View::onXdgUnsetMaximized); - connect(xdgSurface, &QWaylandXdgSurface::unsetFullscreen, view, &View::onXdgUnsetFullscreen); + connect(xdgSurface, &QWaylandXdgSurfaceV5::setMaximized, view, &View::onXdgSetMaximized); + connect(xdgSurface, &QWaylandXdgSurfaceV5::setFullscreen, view, &View::onXdgSetFullscreen); + connect(xdgSurface, &QWaylandXdgSurfaceV5::unsetMaximized, view, &View::onXdgUnsetMaximized); + connect(xdgSurface, &QWaylandXdgSurfaceV5::unsetFullscreen, view, &View::onXdgUnsetFullscreen); } void Compositor::onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, @@ -258,7 +258,7 @@ void Compositor::onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface * { Q_UNUSED(seat); - QWaylandXdgPopup *xdgPopup = new QWaylandXdgPopup(m_xdgShell, surface, parent, position, resource); + QWaylandXdgPopupV5 *xdgPopup = new QWaylandXdgPopupV5(m_xdgShell, surface, parent, position, resource); View *view = findView(surface); Q_ASSERT(view); @@ -283,7 +283,7 @@ void Compositor::onWlStartResize(QWaylandSeat *, QWaylandWlShellSurface::ResizeE } void Compositor::onXdgStartResize(QWaylandSeat *seat, - QWaylandXdgSurface::ResizeEdge edges) + QWaylandXdgSurfaceV5::ResizeEdge edges) { Q_UNUSED(seat); emit startResize(int(edges), true); @@ -403,8 +403,8 @@ void Compositor::handleMouseEvent(QWaylandView *target, QMouseEvent *me) if (surface != input->keyboardFocus()) { if (surface == nullptr || surface->role() == QWaylandWlShellSurface::role() - || surface->role() == QWaylandXdgSurface::role() - || surface->role() == QWaylandXdgPopup::role()) { + || surface->role() == QWaylandXdgSurfaceV5::role() + || surface->role() == QWaylandXdgPopupV5::role()) { input->setKeyboardFocus(surface); } } @@ -428,9 +428,9 @@ void Compositor::handleResize(View *target, const QSize &initialSize, const QPoi wlShellSurface->sendConfigure(newSize, edges); } - QWaylandXdgSurface *xdgSurface = target->m_xdgSurface; + QWaylandXdgSurfaceV5 *xdgSurface = target->m_xdgSurface; if (xdgSurface) { - QWaylandXdgSurface::ResizeEdge edges = static_cast<QWaylandXdgSurface::ResizeEdge>(edge); + QWaylandXdgSurfaceV5::ResizeEdge edges = static_cast<QWaylandXdgSurfaceV5::ResizeEdge>(edge); QSize newSize = xdgSurface->sizeForResize(initialSize, delta, edges); xdgSurface->sendResizing(newSize); } |