summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@kdab.com>2016-08-29 15:15:29 +0200
committerGiulio Camuffo <giulio.camuffo@kdab.com>2016-09-05 11:30:27 +0000
commitda61739728b2df7981b898da5dbdd4b74be068fc (patch)
tree7fc5100c02b883a9f58983bc01b2bf010f1f776d
parent7eccad7db057ed841e3670d14274213dcf8416e5 (diff)
Rename the QWaylandXdg* classes to QWaylandXdg*V5
This frees the QWaylandXdg name for the hopefully coming stable version of xdg-shell. Change-Id: I9beb9b035c6497fb45bee5c9104485b564ca0619 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
-rw-r--r--examples/wayland/minimal-qml/main.qml2
-rw-r--r--examples/wayland/pure-qml/qml/main.qml2
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp38
-rw-r--r--examples/wayland/qwindow-compositor/compositor.h14
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp4
-rw-r--r--src/compositor/extensions/extensions.pri10
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp (renamed from src/compositor/extensions/qwaylandxdgshell.cpp)556
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.h (renamed from src/compositor/extensions/qwaylandxdgshell.h)62
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5_p.h (renamed from src/compositor/extensions/qwaylandxdgshell_p.h)52
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration.cpp (renamed from src/compositor/extensions/qwaylandxdgshellintegration.cpp)56
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration_p.h (renamed from src/compositor/extensions/qwaylandxdgshellintegration_p.h)24
-rw-r--r--src/imports/compositor/plugins.qmltypes16
-rw-r--r--src/imports/compositor/qwaylandquickcompositorplugin.cpp8
-rw-r--r--tests/auto/compositor/compositor/tst_compositor.cpp52
14 files changed, 448 insertions, 448 deletions
diff --git a/examples/wayland/minimal-qml/main.qml b/examples/wayland/minimal-qml/main.qml
index ce64084ce..3d6c3b7bb 100644
--- a/examples/wayland/minimal-qml/main.qml
+++ b/examples/wayland/minimal-qml/main.qml
@@ -75,7 +75,7 @@ WaylandCompositor {
onWlShellSurfaceCreated:
chromeComponent.createObject(surfaceArea, { "shellSurface": shellSurface } );
}
- XdgShell {
+ XdgShellV5 {
onXdgSurfaceCreated:
chromeComponent.createObject(surfaceArea, { "shellSurface": xdgSurface } );
}
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 69e8d2c84..9bce7bcb8 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -73,7 +73,7 @@ WaylandCompositor {
}
}
- XdgShell {
+ XdgShellV5 {
property variant viewsBySurface: ({})
onXdgSurfaceCreated: {
var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } );
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);
}
diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h
index 3de25a9bb..cfeccffda 100644
--- a/examples/wayland/qwindow-compositor/compositor.h
+++ b/examples/wayland/qwindow-compositor/compositor.h
@@ -45,14 +45,14 @@
#include <QtWaylandCompositor/QWaylandSurface>
#include <QtWaylandCompositor/QWaylandView>
#include <QtWaylandCompositor/QWaylandWlShellSurface>
-#include <QtWaylandCompositor/QWaylandXdgSurface>
+#include <QtWaylandCompositor/QWaylandXdgSurfaceV5>
#include <QTimer>
QT_BEGIN_NAMESPACE
class QWaylandWlShell;
class QWaylandWlShellSurface;
-class QWaylandXdgShell;
+class QWaylandXdgShellV5;
class View : public QWaylandView
{
@@ -76,8 +76,8 @@ private:
GLuint m_texture;
QPointF m_position;
QWaylandWlShellSurface *m_wlShellSurface;
- QWaylandXdgSurface *m_xdgSurface;
- QWaylandXdgPopup *m_xdgPopup;
+ QWaylandXdgSurfaceV5 *m_xdgSurface;
+ QWaylandXdgPopupV5 *m_xdgPopup;
View *m_parentView;
QPoint m_offset;
@@ -124,7 +124,7 @@ private slots:
void viewSurfaceDestroyed();
void onStartMove();
void onWlStartResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges);
- void onXdgStartResize(QWaylandSeat *seat, QWaylandXdgSurface::ResizeEdge edges);
+ void onXdgStartResize(QWaylandSeat *seat, QWaylandXdgSurfaceV5::ResizeEdge edges);
void startDrag();
@@ -132,7 +132,7 @@ private slots:
void onSurfaceCreated(QWaylandSurface *surface);
void onWlShellSurfaceCreated(QWaylandWlShellSurface *wlShellSurface);
- void onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface);
+ void onXdgSurfaceCreated(QWaylandXdgSurfaceV5 *xdgSurface);
void onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandSeat *seat,
const QPoint &position, const QWaylandResource &resource);
void onSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy);
@@ -148,7 +148,7 @@ private:
QList<View*> m_views;
QList<View*> m_popupViews;
QWaylandWlShell *m_wlShell;
- QWaylandXdgShell *m_xdgShell;
+ QWaylandXdgShellV5 *m_xdgShell;
QWaylandView m_cursorView;
int m_cursorHotspotX;
int m_cursorHotspotY;
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index b73c7be39..617d79c0e 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -88,11 +88,11 @@ void Window::drawBackground()
QPointF Window::getAnchorPosition(const QPointF &position, int resizeEdge, const QSize &windowSize)
{
float y = position.y();
- if (resizeEdge & QWaylandXdgSurface::ResizeEdge::TopEdge)
+ if (resizeEdge & QWaylandXdgSurfaceV5::ResizeEdge::TopEdge)
y += windowSize.height();
float x = position.x();
- if (resizeEdge & QWaylandXdgSurface::ResizeEdge::LeftEdge)
+ if (resizeEdge & QWaylandXdgSurfaceV5::ResizeEdge::LeftEdge)
x += windowSize.width();
return QPointF(x, y);
diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri
index bb0abe885..d5a14f549 100644
--- a/src/compositor/extensions/extensions.pri
+++ b/src/compositor/extensions/extensions.pri
@@ -21,8 +21,8 @@ HEADERS += \
extensions/qwaylandtextinputmanager_p.h \
extensions/qwaylandqtwindowmanager.h \
extensions/qwaylandqtwindowmanager_p.h \
- extensions/qwaylandxdgshell.h \
- extensions/qwaylandxdgshell_p.h \
+ extensions/qwaylandxdgshellv5.h \
+ extensions/qwaylandxdgshellv5_p.h \
extensions/qwaylandshellsurface.h \
SOURCES += \
@@ -33,19 +33,19 @@ SOURCES += \
extensions/qwaylandtextinput.cpp \
extensions/qwaylandtextinputmanager.cpp \
extensions/qwaylandqtwindowmanager.cpp \
- extensions/qwaylandxdgshell.cpp \
+ extensions/qwaylandxdgshellv5.cpp \
qtHaveModule(quick):contains(QT_CONFIG, opengl) {
HEADERS += \
extensions/qwaylandquickshellsurfaceitem.h \
extensions/qwaylandquickshellsurfaceitem_p.h \
extensions/qwaylandwlshellintegration_p.h \
- extensions/qwaylandxdgshellintegration_p.h \
+ extensions/qwaylandxdgshellv5integration_p.h \
SOURCES += \
extensions/qwaylandquickshellsurfaceitem.cpp \
extensions/qwaylandwlshellintegration.cpp \
- extensions/qwaylandxdgshellintegration.cpp \
+ extensions/qwaylandxdgshellv5integration.cpp \
}
diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp
index ab2c60ecc..284aa8b05 100644
--- a/src/compositor/extensions/qwaylandxdgshell.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp
@@ -34,11 +34,11 @@
**
****************************************************************************/
-#include "qwaylandxdgshell.h"
-#include "qwaylandxdgshell_p.h"
+#include "qwaylandxdgshellv5.h"
+#include "qwaylandxdgshellv5_p.h"
#ifdef QT_WAYLAND_COMPOSITOR_QUICK
-#include "qwaylandxdgshellintegration_p.h"
+#include "qwaylandxdgshellv5integration_p.h"
#endif
#include <QtWaylandCompositor/QWaylandCompositor>
@@ -53,76 +53,76 @@
QT_BEGIN_NAMESPACE
-QWaylandSurfaceRole QWaylandXdgSurfacePrivate::s_role("xdg_surface");
-QWaylandSurfaceRole QWaylandXdgPopupPrivate::s_role("xdg_popup");
+QWaylandSurfaceRole QWaylandXdgSurfaceV5Private::s_role("xdg_surface");
+QWaylandSurfaceRole QWaylandXdgPopupV5Private::s_role("xdg_popup");
-QWaylandXdgShellPrivate::QWaylandXdgShellPrivate()
+QWaylandXdgShellV5Private::QWaylandXdgShellV5Private()
: QWaylandCompositorExtensionPrivate()
, xdg_shell()
{
}
-void QWaylandXdgShellPrivate::ping(Resource *resource, uint32_t serial)
+void QWaylandXdgShellV5Private::ping(Resource *resource, uint32_t serial)
{
m_pings.insert(serial);
send_ping(resource->handle, serial);
}
-void QWaylandXdgShellPrivate::registerSurface(QWaylandXdgSurface *xdgSurface)
+void QWaylandXdgShellV5Private::registerSurface(QWaylandXdgSurfaceV5 *xdgSurface)
{
m_xdgSurfaces.insert(xdgSurface->surface()->client()->client(), xdgSurface);
}
-void QWaylandXdgShellPrivate::unregisterXdgSurface(QWaylandXdgSurface *xdgSurface)
+void QWaylandXdgShellV5Private::unregisterXdgSurface(QWaylandXdgSurfaceV5 *xdgSurface)
{
- auto xdgSurfacePrivate = QWaylandXdgSurfacePrivate::get(xdgSurface);
+ auto xdgSurfacePrivate = QWaylandXdgSurfaceV5Private::get(xdgSurface);
if (!m_xdgSurfaces.remove(xdgSurfacePrivate->resource()->client(), xdgSurface))
qWarning("%s Unexpected state. Can't find registered xdg surface\n", Q_FUNC_INFO);
}
-void QWaylandXdgShellPrivate::registerXdgPopup(QWaylandXdgPopup *xdgPopup)
+void QWaylandXdgShellV5Private::registerXdgPopup(QWaylandXdgPopupV5 *xdgPopup)
{
m_xdgPopups.insert(xdgPopup->surface()->client()->client(), xdgPopup);
}
-void QWaylandXdgShellPrivate::unregisterXdgPopup(QWaylandXdgPopup *xdgPopup)
+void QWaylandXdgShellV5Private::unregisterXdgPopup(QWaylandXdgPopupV5 *xdgPopup)
{
- auto xdgPopupPrivate = QWaylandXdgPopupPrivate::get(xdgPopup);
+ auto xdgPopupPrivate = QWaylandXdgPopupV5Private::get(xdgPopup);
if (!m_xdgPopups.remove(xdgPopupPrivate->resource()->client(), xdgPopup))
qWarning("%s Unexpected state. Can't find registered xdg popup\n", Q_FUNC_INFO);
}
-bool QWaylandXdgShellPrivate::isValidPopupParent(QWaylandSurface *parentSurface) const
+bool QWaylandXdgShellV5Private::isValidPopupParent(QWaylandSurface *parentSurface) const
{
- QWaylandXdgPopup *topmostPopup = topmostPopupForClient(parentSurface->client()->client());
+ QWaylandXdgPopupV5 *topmostPopup = topmostPopupForClient(parentSurface->client()->client());
if (topmostPopup && topmostPopup->surface() != parentSurface) {
return false;
}
QWaylandSurfaceRole *parentRole = parentSurface->role();
- if (parentRole != QWaylandXdgSurface::role() && parentRole != QWaylandXdgPopup::role()) {
+ if (parentRole != QWaylandXdgSurfaceV5::role() && parentRole != QWaylandXdgPopupV5::role()) {
return false;
}
return true;
}
-QWaylandXdgPopup *QWaylandXdgShellPrivate::topmostPopupForClient(wl_client *client) const
+QWaylandXdgPopupV5 *QWaylandXdgShellV5Private::topmostPopupForClient(wl_client *client) const
{
- QList<QWaylandXdgPopup *> clientPopups = m_xdgPopups.values(client);
+ QList<QWaylandXdgPopupV5 *> clientPopups = m_xdgPopups.values(client);
return clientPopups.empty() ? nullptr : clientPopups.last();
}
-QWaylandXdgSurface *QWaylandXdgShellPrivate::xdgSurfaceFromSurface(QWaylandSurface *surface)
+QWaylandXdgSurfaceV5 *QWaylandXdgShellV5Private::xdgSurfaceFromSurface(QWaylandSurface *surface)
{
- Q_FOREACH (QWaylandXdgSurface *xdgSurface, m_xdgSurfaces) {
+ Q_FOREACH (QWaylandXdgSurfaceV5 *xdgSurface, m_xdgSurfaces) {
if (surface == xdgSurface->surface())
return xdgSurface;
}
return nullptr;
}
-void QWaylandXdgShellPrivate::xdg_shell_destroy(Resource *resource)
+void QWaylandXdgShellV5Private::xdg_shell_destroy(Resource *resource)
{
if (!m_xdgSurfaces.values(resource->client()).empty())
wl_resource_post_error(resource->handle, XDG_SHELL_ERROR_DEFUNCT_SURFACES,
@@ -131,10 +131,10 @@ void QWaylandXdgShellPrivate::xdg_shell_destroy(Resource *resource)
wl_resource_destroy(resource->handle);
}
-void QWaylandXdgShellPrivate::xdg_shell_get_xdg_surface(Resource *resource, uint32_t id,
+void QWaylandXdgShellV5Private::xdg_shell_get_xdg_surface(Resource *resource, uint32_t id,
wl_resource *surface_res)
{
- Q_Q(QWaylandXdgShell);
+ Q_Q(QWaylandXdgShellV5);
QWaylandSurface *surface = QWaylandSurface::fromResource(surface_res);
if (xdgSurfaceFromSurface(surface)) {
@@ -144,7 +144,7 @@ void QWaylandXdgShellPrivate::xdg_shell_get_xdg_surface(Resource *resource, uint
return;
}
- if (!surface->setRole(QWaylandXdgSurface::role(), resource->handle, XDG_SHELL_ERROR_ROLE))
+ if (!surface->setRole(QWaylandXdgSurfaceV5::role(), resource->handle, XDG_SHELL_ERROR_ROLE))
return;
QWaylandResource xdgSurfaceResource(wl_resource_create(resource->client(), &xdg_surface_interface,
@@ -152,18 +152,18 @@ void QWaylandXdgShellPrivate::xdg_shell_get_xdg_surface(Resource *resource, uint
emit q->xdgSurfaceRequested(surface, xdgSurfaceResource);
- QWaylandXdgSurface *xdgSurface = QWaylandXdgSurface::fromResource(xdgSurfaceResource.resource());
+ QWaylandXdgSurfaceV5 *xdgSurface = QWaylandXdgSurfaceV5::fromResource(xdgSurfaceResource.resource());
if (!xdgSurface) {
- // A QWaylandXdgSurface was not created in response to the xdgSurfaceRequested signal, so we
+ // A QWaylandXdgSurfaceV5 was not created in response to the xdgSurfaceRequested signal, so we
// create one as fallback here instead.
- xdgSurface = new QWaylandXdgSurface(q, surface, xdgSurfaceResource);
+ xdgSurface = new QWaylandXdgSurfaceV5(q, surface, xdgSurfaceResource);
}
registerSurface(xdgSurface);
emit q->xdgSurfaceCreated(xdgSurface);
}
-void QWaylandXdgShellPrivate::xdg_shell_use_unstable_version(Resource *resource, int32_t version)
+void QWaylandXdgShellV5Private::xdg_shell_use_unstable_version(Resource *resource, int32_t version)
{
if (xdg_shell::version_current != version) {
wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT,
@@ -172,13 +172,13 @@ void QWaylandXdgShellPrivate::xdg_shell_use_unstable_version(Resource *resource,
}
}
-void QWaylandXdgShellPrivate::xdg_shell_get_xdg_popup(Resource *resource, uint32_t id,
+void QWaylandXdgShellV5Private::xdg_shell_get_xdg_popup(Resource *resource, uint32_t id,
wl_resource *surface_res, wl_resource *parent,
wl_resource *seatResource, uint32_t serial,
int32_t x, int32_t y)
{
Q_UNUSED(serial);
- Q_Q(QWaylandXdgShell);
+ Q_Q(QWaylandXdgShellV5);
QWaylandSurface *surface = QWaylandSurface::fromResource(surface_res);
QWaylandSurface *parentSurface = QWaylandSurface::fromResource(parent);
@@ -188,7 +188,7 @@ void QWaylandXdgShellPrivate::xdg_shell_get_xdg_popup(Resource *resource, uint32
return;
}
- if (!surface->setRole(QWaylandXdgPopup::role(), resource->handle, XDG_SHELL_ERROR_ROLE)) {
+ if (!surface->setRole(QWaylandXdgPopupV5::role(), resource->handle, XDG_SHELL_ERROR_ROLE)) {
return;
}
@@ -198,28 +198,28 @@ void QWaylandXdgShellPrivate::xdg_shell_get_xdg_popup(Resource *resource, uint32
QPoint position(x, y);
emit q->xdgPopupRequested(surface, parentSurface, seat, position, xdgPopupResource);
- QWaylandXdgPopup *xdgPopup = QWaylandXdgPopup::fromResource(xdgPopupResource.resource());
+ QWaylandXdgPopupV5 *xdgPopup = QWaylandXdgPopupV5::fromResource(xdgPopupResource.resource());
if (!xdgPopup) {
- // A QWaylandXdgPopup was not created in response to the xdgPopupRequested signal, so we
+ // A QWaylandXdgPopupV5 was not created in response to the xdgPopupRequested signal, so we
// create one as fallback here instead.
- xdgPopup = new QWaylandXdgPopup(q, surface, parentSurface, position, xdgPopupResource);
+ xdgPopup = new QWaylandXdgPopupV5(q, surface, parentSurface, position, xdgPopupResource);
}
registerXdgPopup(xdgPopup);
emit q->xdgPopupCreated(xdgPopup);
}
-void QWaylandXdgShellPrivate::xdg_shell_pong(Resource *resource, uint32_t serial)
+void QWaylandXdgShellV5Private::xdg_shell_pong(Resource *resource, uint32_t serial)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgShell);
+ Q_Q(QWaylandXdgShellV5);
if (m_pings.remove(serial))
emit q->pong(serial);
else
qWarning("Received an unexpected pong!");
}
-QWaylandXdgSurfacePrivate::QWaylandXdgSurfacePrivate()
+QWaylandXdgSurfaceV5Private::QWaylandXdgSurfaceV5Private()
: QWaylandCompositorExtensionPrivate()
, xdg_surface()
, m_surface(nullptr)
@@ -230,36 +230,36 @@ QWaylandXdgSurfacePrivate::QWaylandXdgSurfacePrivate()
{
}
-void QWaylandXdgSurfacePrivate::handleFocusLost()
+void QWaylandXdgSurfaceV5Private::handleFocusLost()
{
- Q_Q(QWaylandXdgSurface);
- QWaylandXdgSurfacePrivate::ConfigureEvent current = lastSentConfigure();
- current.states.removeOne(QWaylandXdgSurface::State::ActivatedState);
+ Q_Q(QWaylandXdgSurfaceV5);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent current = lastSentConfigure();
+ current.states.removeOne(QWaylandXdgSurfaceV5::State::ActivatedState);
q->sendConfigure(current.size, current.states);
}
-void QWaylandXdgSurfacePrivate::handleFocusReceived()
+void QWaylandXdgSurfaceV5Private::handleFocusReceived()
{
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
- QWaylandXdgSurfacePrivate::ConfigureEvent current = lastSentConfigure();
- if (!current.states.contains(QWaylandXdgSurface::State::ActivatedState)) {
- current.states.push_back(QWaylandXdgSurface::State::ActivatedState);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent current = lastSentConfigure();
+ if (!current.states.contains(QWaylandXdgSurfaceV5::State::ActivatedState)) {
+ current.states.push_back(QWaylandXdgSurfaceV5::State::ActivatedState);
}
q->sendConfigure(current.size, current.states);
}
-QRect QWaylandXdgSurfacePrivate::calculateFallbackWindowGeometry() const
+QRect QWaylandXdgSurfaceV5Private::calculateFallbackWindowGeometry() const
{
// TODO: The unset window geometry should include subsurfaces as well, so this solution
// won't work too well on those kinds of clients.
return QRect(QPoint(0, 0), m_surface->size() / m_surface->bufferScale());
}
-void QWaylandXdgSurfacePrivate::updateFallbackWindowGeometry()
+void QWaylandXdgSurfaceV5Private::updateFallbackWindowGeometry()
{
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
if (!m_unsetWindowGeometry)
return;
@@ -271,86 +271,86 @@ void QWaylandXdgSurfacePrivate::updateFallbackWindowGeometry()
emit q->windowGeometryChanged();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_destroy_resource(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_destroy_resource(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
- QWaylandXdgShellPrivate::get(m_xdgShell)->unregisterXdgSurface(q);
+ Q_Q(QWaylandXdgSurfaceV5);
+ QWaylandXdgShellV5Private::get(m_xdgShell)->unregisterXdgSurface(q);
delete q;
}
-void QWaylandXdgSurfacePrivate::xdg_surface_destroy(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_destroy(Resource *resource)
{
wl_resource_destroy(resource->handle);
}
-void QWaylandXdgSurfacePrivate::xdg_surface_move(Resource *resource, wl_resource *seat, uint32_t serial)
+void QWaylandXdgSurfaceV5Private::xdg_surface_move(Resource *resource, wl_resource *seat, uint32_t serial)
{
Q_UNUSED(resource);
Q_UNUSED(serial);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
QWaylandSeat *input_device = QWaylandSeat::fromSeatResource(seat);
emit q->startMove(input_device);
}
-void QWaylandXdgSurfacePrivate::xdg_surface_resize(Resource *resource, wl_resource *seat,
+void QWaylandXdgSurfaceV5Private::xdg_surface_resize(Resource *resource, wl_resource *seat,
uint32_t serial, uint32_t edges)
{
Q_UNUSED(resource);
Q_UNUSED(serial);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
QWaylandSeat *input_device = QWaylandSeat::fromSeatResource(seat);
- emit q->startResize(input_device, QWaylandXdgSurface::ResizeEdge(edges));
+ emit q->startResize(input_device, QWaylandXdgSurfaceV5::ResizeEdge(edges));
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_maximized(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_maximized(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
emit q->setMaximized();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_unset_maximized(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_unset_maximized(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
emit q->unsetMaximized();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_fullscreen(Resource *resource, wl_resource *output_res)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_fullscreen(Resource *resource, wl_resource *output_res)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
QWaylandOutput *output = output_res ? QWaylandOutput::fromResource(output_res) : nullptr;
emit q->setFullscreen(output);
}
-void QWaylandXdgSurfacePrivate::xdg_surface_unset_fullscreen(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_unset_fullscreen(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
emit q->unsetFullscreen();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_minimized(Resource *resource)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_minimized(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
emit q->setMinimized();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_parent(Resource *resource, wl_resource *parent)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_parent(Resource *resource, wl_resource *parent)
{
Q_UNUSED(resource);
- QWaylandXdgSurface *parentSurface = nullptr;
+ QWaylandXdgSurfaceV5 *parentSurface = nullptr;
if (parent) {
- parentSurface = static_cast<QWaylandXdgSurfacePrivate *>(
- QWaylandXdgSurfacePrivate::Resource::fromResource(parent)->xdg_surface_object)->q_func();
+ parentSurface = static_cast<QWaylandXdgSurfaceV5Private *>(
+ QWaylandXdgSurfaceV5Private::Resource::fromResource(parent)->xdg_surface_object)->q_func();
}
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
if (m_parentSurface != parentSurface) {
m_parentSurface = parentSurface;
@@ -368,31 +368,31 @@ void QWaylandXdgSurfacePrivate::xdg_surface_set_parent(Resource *resource, wl_re
}
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_app_id(Resource *resource, const QString &app_id)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_app_id(Resource *resource, const QString &app_id)
{
Q_UNUSED(resource);
if (app_id == m_appId)
return;
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
m_appId = app_id;
emit q->appIdChanged();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_show_window_menu(Resource *resource, wl_resource *seatResource,
+void QWaylandXdgSurfaceV5Private::xdg_surface_show_window_menu(Resource *resource, wl_resource *seatResource,
uint32_t serial, int32_t x, int32_t y)
{
Q_UNUSED(resource);
Q_UNUSED(serial);
QPoint position(x, y);
auto seat = QWaylandSeat::fromSeatResource(seatResource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
emit q->showWindowMenu(seat, position);
}
-void QWaylandXdgSurfacePrivate::xdg_surface_ack_configure(Resource *resource, uint32_t serial)
+void QWaylandXdgSurfaceV5Private::xdg_surface_ack_configure(Resource *resource, uint32_t serial)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
ConfigureEvent config;
Q_FOREVER {
@@ -418,16 +418,16 @@ void QWaylandXdgSurfacePrivate::xdg_surface_ack_configure(Resource *resource, ui
if (!changedStates.empty()) {
Q_FOREACH (uint state, changedStates) {
switch (state) {
- case QWaylandXdgSurface::State::MaximizedState:
+ case QWaylandXdgSurfaceV5::State::MaximizedState:
emit q->maximizedChanged();
break;
- case QWaylandXdgSurface::State::FullscreenState:
+ case QWaylandXdgSurfaceV5::State::FullscreenState:
emit q->fullscreenChanged();
break;
- case QWaylandXdgSurface::State::ResizingState:
+ case QWaylandXdgSurfaceV5::State::ResizingState:
emit q->resizingChanged();
break;
- case QWaylandXdgSurface::State::ActivatedState:
+ case QWaylandXdgSurfaceV5::State::ActivatedState:
emit q->activatedChanged();
break;
}
@@ -438,17 +438,17 @@ void QWaylandXdgSurfacePrivate::xdg_surface_ack_configure(Resource *resource, ui
emit q->ackConfigure(serial);
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_title(Resource *resource, const QString &title)
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_title(Resource *resource, const QString &title)
{
Q_UNUSED(resource);
if (title == m_title)
return;
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
m_title = title;
emit q->titleChanged();
}
-void QWaylandXdgSurfacePrivate::xdg_surface_set_window_geometry(Resource *resource,
+void QWaylandXdgSurfaceV5Private::xdg_surface_set_window_geometry(Resource *resource,
int32_t x, int32_t y,
int32_t width, int32_t height)
{
@@ -463,7 +463,7 @@ void QWaylandXdgSurfacePrivate::xdg_surface_set_window_geometry(Resource *resour
QRect geometry(x, y, width, height);
- Q_Q(QWaylandXdgSurface);
+ Q_Q(QWaylandXdgSurfaceV5);
if ((q->maximized() || q->fullscreen()) && m_lastAckedConfigure.size != geometry.size())
qWarning() << "Client window geometry did not obey last acked configure";
@@ -474,7 +474,7 @@ void QWaylandXdgSurfacePrivate::xdg_surface_set_window_geometry(Resource *resour
emit q->windowGeometryChanged();
}
-QWaylandXdgPopupPrivate::QWaylandXdgPopupPrivate()
+QWaylandXdgPopupV5Private::QWaylandXdgPopupV5Private()
: QWaylandCompositorExtensionPrivate()
, xdg_popup()
, m_surface(nullptr)
@@ -483,44 +483,44 @@ QWaylandXdgPopupPrivate::QWaylandXdgPopupPrivate()
{
}
-void QWaylandXdgPopupPrivate::xdg_popup_destroy_resource(Resource *resource)
+void QWaylandXdgPopupV5Private::xdg_popup_destroy_resource(Resource *resource)
{
Q_UNUSED(resource);
- Q_Q(QWaylandXdgPopup);
- QWaylandXdgShellPrivate::get(m_xdgShell)->unregisterXdgPopup(q);
+ Q_Q(QWaylandXdgPopupV5);
+ QWaylandXdgShellV5Private::get(m_xdgShell)->unregisterXdgPopup(q);
delete q;
}
-void QWaylandXdgPopupPrivate::xdg_popup_destroy(Resource *resource)
+void QWaylandXdgPopupV5Private::xdg_popup_destroy(Resource *resource)
{
//TODO: post error if not topmost popup
wl_resource_destroy(resource->handle);
}
/*!
- * Constructs a QWaylandXdgShell object.
+ * Constructs a QWaylandXdgShellV5 object.
*/
-QWaylandXdgShell::QWaylandXdgShell()
- : QWaylandCompositorExtensionTemplate<QWaylandXdgShell>(*new QWaylandXdgShellPrivate())
+QWaylandXdgShellV5::QWaylandXdgShellV5()
+ : QWaylandCompositorExtensionTemplate<QWaylandXdgShellV5>(*new QWaylandXdgShellV5Private())
{ }
/*!
- * Constructs a QWaylandXdgShell object for the provided \a compositor.
+ * Constructs a QWaylandXdgShellV5 object for the provided \a compositor.
*/
-QWaylandXdgShell::QWaylandXdgShell(QWaylandCompositor *compositor)
- : QWaylandCompositorExtensionTemplate<QWaylandXdgShell>(compositor, *new QWaylandXdgShellPrivate())
+QWaylandXdgShellV5::QWaylandXdgShellV5(QWaylandCompositor *compositor)
+ : QWaylandCompositorExtensionTemplate<QWaylandXdgShellV5>(compositor, *new QWaylandXdgShellV5Private())
{ }
/*!
* Initializes the shell extension.
*/
-void QWaylandXdgShell::initialize()
+void QWaylandXdgShellV5::initialize()
{
- Q_D(QWaylandXdgShell);
+ Q_D(QWaylandXdgShellV5);
QWaylandCompositorExtensionTemplate::initialize();
QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(extensionContainer());
if (!compositor) {
- qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandXdgShell";
+ qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandXdgShellV5";
return;
}
d->init(compositor->display(), 1);
@@ -528,20 +528,20 @@ void QWaylandXdgShell::initialize()
handleSeatChanged(compositor->defaultSeat(), nullptr);
connect(compositor, &QWaylandCompositor::defaultSeatChanged,
- this, &QWaylandXdgShell::handleSeatChanged);
+ this, &QWaylandXdgShellV5::handleSeatChanged);
}
/*!
- * Returns the Wayland interface for the QWaylandXdgShell.
+ * Returns the Wayland interface for the QWaylandXdgShellV5.
*/
-const struct wl_interface *QWaylandXdgShell::interface()
+const struct wl_interface *QWaylandXdgShellV5::interface()
{
- return QWaylandXdgShellPrivate::interface();
+ return QWaylandXdgShellV5Private::interface();
}
-QByteArray QWaylandXdgShell::interfaceName()
+QByteArray QWaylandXdgShellV5::interfaceName()
{
- return QWaylandXdgShellPrivate::interfaceName();
+ return QWaylandXdgShellV5Private::interfaceName();
}
/*!
@@ -555,68 +555,68 @@ QByteArray QWaylandXdgShell::interfaceName()
* Sends a ping event to the client. If the client replies to the event the
* \a pong signal will be emitted.
*/
-uint QWaylandXdgShell::ping(QWaylandClient *client)
+uint QWaylandXdgShellV5::ping(QWaylandClient *client)
{
- Q_D(QWaylandXdgShell);
+ Q_D(QWaylandXdgShellV5);
QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(extensionContainer());
Q_ASSERT(compositor);
uint32_t serial = compositor->nextSerial();
- QWaylandXdgShellPrivate::Resource *clientResource = d->resourceMap().value(client->client(), nullptr);
+ QWaylandXdgShellV5Private::Resource *clientResource = d->resourceMap().value(client->client(), nullptr);
Q_ASSERT(clientResource);
d->ping(clientResource, serial);
return serial;
}
-void QWaylandXdgShell::closeAllPopups()
+void QWaylandXdgShellV5::closeAllPopups()
{
- Q_D(QWaylandXdgShell);
+ Q_D(QWaylandXdgShellV5);
Q_FOREACH (struct wl_client *client, d->m_xdgPopups.keys()) {
- QList<QWaylandXdgPopup *> popups = d->m_xdgPopups.values(client);
+ QList<QWaylandXdgPopupV5 *> popups = d->m_xdgPopups.values(client);
std::reverse(popups.begin(), popups.end());
- Q_FOREACH (QWaylandXdgPopup *currentTopmostPopup, popups) {
+ Q_FOREACH (QWaylandXdgPopupV5 *currentTopmostPopup, popups) {
currentTopmostPopup->sendPopupDone();
}
}
}
-void QWaylandXdgShell::handleSeatChanged(QWaylandSeat *newSeat, QWaylandSeat *oldSeat)
+void QWaylandXdgShellV5::handleSeatChanged(QWaylandSeat *newSeat, QWaylandSeat *oldSeat)
{
if (oldSeat != nullptr) {
disconnect(oldSeat, &QWaylandSeat::keyboardFocusChanged,
- this, &QWaylandXdgShell::handleFocusChanged);
+ this, &QWaylandXdgShellV5::handleFocusChanged);
}
if (newSeat != nullptr) {
connect(newSeat, &QWaylandSeat::keyboardFocusChanged,
- this, &QWaylandXdgShell::handleFocusChanged);
+ this, &QWaylandXdgShellV5::handleFocusChanged);
}
}
-void QWaylandXdgShell::handleFocusChanged(QWaylandSurface *newSurface, QWaylandSurface *oldSurface)
+void QWaylandXdgShellV5::handleFocusChanged(QWaylandSurface *newSurface, QWaylandSurface *oldSurface)
{
- Q_D(QWaylandXdgShell);
+ Q_D(QWaylandXdgShellV5);
- QWaylandXdgSurface *newXdgSurface = d->xdgSurfaceFromSurface(newSurface);
- QWaylandXdgSurface *oldXdgSurface = d->xdgSurfaceFromSurface(oldSurface);
+ QWaylandXdgSurfaceV5 *newXdgSurface = d->xdgSurfaceFromSurface(newSurface);
+ QWaylandXdgSurfaceV5 *oldXdgSurface = d->xdgSurfaceFromSurface(oldSurface);
if (newXdgSurface)
- QWaylandXdgSurfacePrivate::get(newXdgSurface)->handleFocusReceived();
+ QWaylandXdgSurfaceV5Private::get(newXdgSurface)->handleFocusReceived();
if (oldXdgSurface)
- QWaylandXdgSurfacePrivate::get(oldXdgSurface)->handleFocusLost();
+ QWaylandXdgSurfaceV5Private::get(oldXdgSurface)->handleFocusLost();
}
/*!
- * \class QWaylandXdgSurface
+ * \class QWaylandXdgSurfaceV5
* \inmodule QtWaylandCompositor
* \preliminary
- * \brief The QWaylandXdgSurface class provides desktop-style compositor-specific features to an xdg surface.
+ * \brief The QWaylandXdgSurfaceV5 class provides desktop-style compositor-specific features to an xdg surface.
*
- * This class is part of the QWaylandXdgShell extension and provides a way to
+ * This class is part of the QWaylandXdgShellV5 extension and provides a way to
* extend the functionality of an existing QWaylandSurface with features
* specific to desktop-style compositors, such as resizing and moving the
* surface.
@@ -639,19 +639,19 @@ void QWaylandXdgShell::handleFocusChanged(QWaylandSurface *newSurface, QWaylandS
*/
/*!
- * Constructs a QWaylandXdgSurface.
+ * Constructs a QWaylandXdgSurfaceV5.
*/
-QWaylandXdgSurface::QWaylandXdgSurface()
- : QWaylandShellSurfaceTemplate<QWaylandXdgSurface>(*new QWaylandXdgSurfacePrivate)
+QWaylandXdgSurfaceV5::QWaylandXdgSurfaceV5()
+ : QWaylandShellSurfaceTemplate<QWaylandXdgSurfaceV5>(*new QWaylandXdgSurfaceV5Private)
{
}
/*!
- * Constructs a QWaylandXdgSurface for \a surface and initializes it with the
+ * Constructs a QWaylandXdgSurfaceV5 for \a surface and initializes it with the
* given \a xdgShell, \a surface, and resource \a res.
*/
-QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &res)
- : QWaylandShellSurfaceTemplate<QWaylandXdgSurface>(*new QWaylandXdgSurfacePrivate)
+QWaylandXdgSurfaceV5::QWaylandXdgSurfaceV5(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface, const QWaylandResource &res)
+ : QWaylandShellSurfaceTemplate<QWaylandXdgSurfaceV5>(*new QWaylandXdgSurfaceV5Private)
{
initialize(xdgShell, surface, res);
}
@@ -664,19 +664,19 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *xdgShell, QWaylandSurfa
*/
/*!
- * Initializes the QWaylandXdgSurface, associating it with the given \a xdgShell, \a surface
+ * Initializes the QWaylandXdgSurfaceV5, associating it with the given \a xdgShell, \a surface
* and \a resource.
*/
-void QWaylandXdgSurface::initialize(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, const QWaylandResource &resource)
+void QWaylandXdgSurfaceV5::initialize(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface, const QWaylandResource &resource)
{
- Q_D(QWaylandXdgSurface);
+ Q_D(QWaylandXdgSurfaceV5);
d->m_xdgShell = xdgShell;
d->m_surface = surface;
d->init(resource.resource());
setExtensionContainer(surface);
d->m_windowGeometry = d->calculateFallbackWindowGeometry();
- connect(surface, &QWaylandSurface::sizeChanged, this, &QWaylandXdgSurface::handleSurfaceSizeChanged);
- connect(surface, &QWaylandSurface::bufferScaleChanged, this, &QWaylandXdgSurface::handleBufferScaleChanged);
+ connect(surface, &QWaylandSurface::sizeChanged, this, &QWaylandXdgSurfaceV5::handleSurfaceSizeChanged);
+ connect(surface, &QWaylandSurface::bufferScaleChanged, this, &QWaylandXdgSurfaceV5::handleBufferScaleChanged);
emit shellChanged();
emit surfaceChanged();
emit windowGeometryChanged();
@@ -686,12 +686,12 @@ void QWaylandXdgSurface::initialize(QWaylandXdgShell *xdgShell, QWaylandSurface
/*!
* \internal
*/
-void QWaylandXdgSurface::initialize()
+void QWaylandXdgSurfaceV5::initialize()
{
QWaylandCompositorExtension::initialize();
}
-QList<int> QWaylandXdgSurface::statesAsInts() const
+QList<int> QWaylandXdgSurfaceV5::statesAsInts() const
{
QList<int> list;
Q_FOREACH (uint state, states()) {
@@ -700,15 +700,15 @@ QList<int> QWaylandXdgSurface::statesAsInts() const
return list;
}
-void QWaylandXdgSurface::handleSurfaceSizeChanged()
+void QWaylandXdgSurfaceV5::handleSurfaceSizeChanged()
{
- Q_D(QWaylandXdgSurface);
+ Q_D(QWaylandXdgSurfaceV5);
d->updateFallbackWindowGeometry();
}
-void QWaylandXdgSurface::handleBufferScaleChanged()
+void QWaylandXdgSurfaceV5::handleBufferScaleChanged()
{
- Q_D(QWaylandXdgSurface);
+ Q_D(QWaylandXdgSurfaceV5);
d->updateFallbackWindowGeometry();
}
@@ -719,13 +719,13 @@ void QWaylandXdgSurface::handleBufferScaleChanged()
*/
/*!
- * \property QWaylandXdgSurface::shell
+ * \property QWaylandXdgSurfaceV5::shell
*
- * This property holds the shell associated with this QWaylandXdgSurface.
+ * This property holds the shell associated with this QWaylandXdgSurfaceV5.
*/
-QWaylandXdgShell *QWaylandXdgSurface::shell() const
+QWaylandXdgShellV5 *QWaylandXdgSurfaceV5::shell() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_xdgShell;
}
@@ -736,13 +736,13 @@ QWaylandXdgShell *QWaylandXdgSurface::shell() const
*/
/*!
- * \property QWaylandXdgSurface::surface
+ * \property QWaylandXdgSurfaceV5::surface
*
- * This property holds the surface associated with this QWaylandXdgSurface.
+ * This property holds the surface associated with this QWaylandXdgSurfaceV5.
*/
-QWaylandSurface *QWaylandXdgSurface::surface() const
+QWaylandSurface *QWaylandXdgSurfaceV5::surface() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_surface;
}
@@ -758,18 +758,18 @@ QWaylandSurface *QWaylandXdgSurface::surface() const
*/
/*!
- * \property QWaylandXdgSurface::parentSurface
+ * \property QWaylandXdgSurfaceV5::parentSurface
*
* This property holds the XdgSurface parent of this XdgSurface.
* When a parent surface is set, the parentSurfaceChanged() signal
* is guaranteed to be emitted before setTopLevel() and setTransient().
*
- * \sa QWaylandXdgSurface::setTopLevel()
- * \sa QWaylandXdgSurface::setTransient()
+ * \sa QWaylandXdgSurfaceV5::setTopLevel()
+ * \sa QWaylandXdgSurfaceV5::setTransient()
*/
-QWaylandXdgSurface *QWaylandXdgSurface::parentSurface() const
+QWaylandXdgSurfaceV5 *QWaylandXdgSurfaceV5::parentSurface() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_parentSurface;
}
@@ -780,111 +780,111 @@ QWaylandXdgSurface *QWaylandXdgSurface::parentSurface() const
*/
/*!
- * \property QWaylandXdgSurface::title
+ * \property QWaylandXdgSurfaceV5::title
*
- * This property holds the title of the QWaylandXdgSurface.
+ * This property holds the title of the QWaylandXdgSurfaceV5.
*/
-QString QWaylandXdgSurface::title() const
+QString QWaylandXdgSurfaceV5::title() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_title;
}
/*!
- * \property QWaylandXdgSurface::appId
+ * \property QWaylandXdgSurfaceV5::appId
*
- * This property holds the app id of the QWaylandXdgSurface.
+ * This property holds the app id of the QWaylandXdgSurfaceV5.
*/
-QString QWaylandXdgSurface::appId() const
+QString QWaylandXdgSurfaceV5::appId() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_appId;
}
/*!
- * \property QWaylandXdgSurface::windowGeometry
+ * \property QWaylandXdgSurfaceV5::windowGeometry
*
- * This property holds the window geometry of the QWaylandXdgSurface. The window
+ * This property holds the window geometry of the QWaylandXdgSurfaceV5. The window
* geometry describes the window's visible bounds from the user's perspective.
* The geometry includes title bars and borders if drawn by the client, but
* excludes drop shadows. It is meant to be used for aligning and tiling
* windows.
*/
-QRect QWaylandXdgSurface::windowGeometry() const
+QRect QWaylandXdgSurfaceV5::windowGeometry() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_windowGeometry;
}
/*!
- * \property QWaylandXdgSurface::states
+ * \property QWaylandXdgSurfaceV5::states
*
- * This property holds the last states the client acknowledged for this QWaylandXdgSurface.
+ * This property holds the last states the client acknowledged for this QWaylandXdgSurfaceV5.
*/
-QVector<uint> QWaylandXdgSurface::states() const
+QVector<uint> QWaylandXdgSurfaceV5::states() const
{
- Q_D(const QWaylandXdgSurface);
+ Q_D(const QWaylandXdgSurfaceV5);
return d->m_lastAckedConfigure.states;
}
-bool QWaylandXdgSurface::maximized() const
+bool QWaylandXdgSurfaceV5::maximized() const
{
- Q_D(const QWaylandXdgSurface);
- return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurface::State::MaximizedState);
+ Q_D(const QWaylandXdgSurfaceV5);
+ return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurfaceV5::State::MaximizedState);
}
-bool QWaylandXdgSurface::fullscreen() const
+bool QWaylandXdgSurfaceV5::fullscreen() const
{
- Q_D(const QWaylandXdgSurface);
- return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurface::State::FullscreenState);
+ Q_D(const QWaylandXdgSurfaceV5);
+ return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurfaceV5::State::FullscreenState);
}
-bool QWaylandXdgSurface::resizing() const
+bool QWaylandXdgSurfaceV5::resizing() const
{
- Q_D(const QWaylandXdgSurface);
- return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurface::State::ResizingState);
+ Q_D(const QWaylandXdgSurfaceV5);
+ return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurfaceV5::State::ResizingState);
}
-bool QWaylandXdgSurface::activated() const
+bool QWaylandXdgSurfaceV5::activated() const
{
- Q_D(const QWaylandXdgSurface);
- return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurface::State::ActivatedState);
+ Q_D(const QWaylandXdgSurfaceV5);
+ return d->m_lastAckedConfigure.states.contains(QWaylandXdgSurfaceV5::State::ActivatedState);
}
/*!
- * Returns the Wayland interface for the QWaylandXdgSurface.
+ * Returns the Wayland interface for the QWaylandXdgSurfaceV5.
*/
-const wl_interface *QWaylandXdgSurface::interface()
+const wl_interface *QWaylandXdgSurfaceV5::interface()
{
- return QWaylandXdgSurfacePrivate::interface();
+ return QWaylandXdgSurfaceV5Private::interface();
}
-QByteArray QWaylandXdgSurface::interfaceName()
+QByteArray QWaylandXdgSurfaceV5::interfaceName()
{
- return QWaylandXdgSurfacePrivate::interfaceName();
+ return QWaylandXdgSurfaceV5Private::interfaceName();
}
/*!
- * Returns the surface role for the QWaylandXdgSurface.
+ * Returns the surface role for the QWaylandXdgSurfaceV5.
*/
-QWaylandSurfaceRole *QWaylandXdgSurface::role()
+QWaylandSurfaceRole *QWaylandXdgSurfaceV5::role()
{
- return &QWaylandXdgSurfacePrivate::s_role;
+ return &QWaylandXdgSurfaceV5Private::s_role;
}
/*!
- * Returns the QWaylandXdgSurface corresponding to the \a resource.
+ * Returns the QWaylandXdgSurfaceV5 corresponding to the \a resource.
*/
-QWaylandXdgSurface *QWaylandXdgSurface::fromResource(wl_resource *resource)
+QWaylandXdgSurfaceV5 *QWaylandXdgSurfaceV5::fromResource(wl_resource *resource)
{
- auto xsResource = QWaylandXdgSurfacePrivate::Resource::fromResource(resource);
+ auto xsResource = QWaylandXdgSurfaceV5Private::Resource::fromResource(resource);
if (!xsResource)
return nullptr;
- return static_cast<QWaylandXdgSurfacePrivate *>(xsResource->xdg_surface_object)->q_func();
+ return static_cast<QWaylandXdgSurfaceV5Private *>(xsResource->xdg_surface_object)->q_func();
}
-QSize QWaylandXdgSurface::sizeForResize(const QSizeF &size, const QPointF &delta,
- QWaylandXdgSurface::ResizeEdge edge)
+QSize QWaylandXdgSurfaceV5::sizeForResize(const QSizeF &size, const QPointF &delta,
+ QWaylandXdgSurfaceV5::ResizeEdge edge)
{
qreal width = size.width();
qreal height = size.height();
@@ -908,24 +908,24 @@ QSize QWaylandXdgSurface::sizeForResize(const QSizeF &size, const QPointF &delta
*/
/*!
- * Sends a configure event to the client. Known states are enumerated in QWaylandXdgSurface::State
+ * Sends a configure event to the client. Known states are enumerated in QWaylandXdgSurfaceV5::State
*/
-uint QWaylandXdgSurface::sendConfigure(const QSize &size, const QVector<uint> &states)
+uint QWaylandXdgSurfaceV5::sendConfigure(const QSize &size, const QVector<uint> &states)
{
- Q_D(QWaylandXdgSurface);
+ Q_D(QWaylandXdgSurfaceV5);
auto statesBytes = QByteArray::fromRawData((char *)states.data(), states.size() * sizeof(State));
QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(extensionContainer());
Q_ASSERT(compositor);
uint32_t serial = compositor->nextSerial();
- d->m_pendingConfigures.append(QWaylandXdgSurfacePrivate::ConfigureEvent{states, size, serial});
+ d->m_pendingConfigures.append(QWaylandXdgSurfaceV5Private::ConfigureEvent{states, size, serial});
d->send_configure(size.width(), size.height(), statesBytes, serial);
return serial;
}
-uint QWaylandXdgSurface::sendConfigure(const QSize &size, const QVector<QWaylandXdgSurface::State> &states)
+uint QWaylandXdgSurfaceV5::sendConfigure(const QSize &size, const QVector<QWaylandXdgSurfaceV5::State> &states)
{
QVector<uint> asUints;
- Q_FOREACH (QWaylandXdgSurface::State state, states) {
+ Q_FOREACH (QWaylandXdgSurfaceV5::State state, states) {
asUints << state;
}
return sendConfigure(size, asUints);
@@ -940,77 +940,77 @@ uint QWaylandXdgSurface::sendConfigure(const QSize &size, const QVector<QWayland
/*!
* Sends a close event to the client.
*/
-void QWaylandXdgSurface::sendClose()
+void QWaylandXdgSurfaceV5::sendClose()
{
- Q_D(QWaylandXdgSurface);
+ Q_D(QWaylandXdgSurfaceV5);
d->send_close();
}
-uint QWaylandXdgSurface::sendMaximized(const QSize &size)
+uint QWaylandXdgSurfaceV5::sendMaximized(const QSize &size)
{
- Q_D(QWaylandXdgSurface);
- QWaylandXdgSurfacePrivate::ConfigureEvent conf = d->lastSentConfigure();
+ Q_D(QWaylandXdgSurfaceV5);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent conf = d->lastSentConfigure();
- if (!conf.states.contains(QWaylandXdgSurface::State::MaximizedState))
- conf.states.append(QWaylandXdgSurface::State::MaximizedState);
- conf.states.removeOne(QWaylandXdgSurface::State::FullscreenState);
- conf.states.removeOne(QWaylandXdgSurface::State::ResizingState);
+ if (!conf.states.contains(QWaylandXdgSurfaceV5::State::MaximizedState))
+ conf.states.append(QWaylandXdgSurfaceV5::State::MaximizedState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::FullscreenState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::ResizingState);
return sendConfigure(size, conf.states);
}
-uint QWaylandXdgSurface::sendUnmaximized(const QSize &size)
+uint QWaylandXdgSurfaceV5::sendUnmaximized(const QSize &size)
{
- Q_D(QWaylandXdgSurface);
- QWaylandXdgSurfacePrivate::ConfigureEvent conf = d->lastSentConfigure();
+ Q_D(QWaylandXdgSurfaceV5);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent conf = d->lastSentConfigure();
- conf.states.removeOne(QWaylandXdgSurface::State::MaximizedState);
- conf.states.removeOne(QWaylandXdgSurface::State::FullscreenState);
- conf.states.removeOne(QWaylandXdgSurface::State::ResizingState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::MaximizedState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::FullscreenState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::ResizingState);
return sendConfigure(size, conf.states);
}
-uint QWaylandXdgSurface::sendFullscreen(const QSize &size)
+uint QWaylandXdgSurfaceV5::sendFullscreen(const QSize &size)
{
- Q_D(QWaylandXdgSurface);
- QWaylandXdgSurfacePrivate::ConfigureEvent conf = d->lastSentConfigure();
+ Q_D(QWaylandXdgSurfaceV5);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent conf = d->lastSentConfigure();
- if (!conf.states.contains(QWaylandXdgSurface::State::FullscreenState))
- conf.states.append(QWaylandXdgSurface::State::FullscreenState);
- conf.states.removeOne(QWaylandXdgSurface::State::MaximizedState);
- conf.states.removeOne(QWaylandXdgSurface::State::ResizingState);
+ if (!conf.states.contains(QWaylandXdgSurfaceV5::State::FullscreenState))
+ conf.states.append(QWaylandXdgSurfaceV5::State::FullscreenState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::MaximizedState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::ResizingState);
return sendConfigure(size, conf.states);
}
-uint QWaylandXdgSurface::sendResizing(const QSize &maxSize)
+uint QWaylandXdgSurfaceV5::sendResizing(const QSize &maxSize)
{
- Q_D(QWaylandXdgSurface);
- QWaylandXdgSurfacePrivate::ConfigureEvent conf = d->lastSentConfigure();
+ Q_D(QWaylandXdgSurfaceV5);
+ QWaylandXdgSurfaceV5Private::ConfigureEvent conf = d->lastSentConfigure();
- if (!conf.states.contains(QWaylandXdgSurface::State::ResizingState))
- conf.states.append(QWaylandXdgSurface::State::ResizingState);
- conf.states.removeOne(QWaylandXdgSurface::State::MaximizedState);
- conf.states.removeOne(QWaylandXdgSurface::State::FullscreenState);
+ if (!conf.states.contains(QWaylandXdgSurfaceV5::State::ResizingState))
+ conf.states.append(QWaylandXdgSurfaceV5::State::ResizingState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::MaximizedState);
+ conf.states.removeOne(QWaylandXdgSurfaceV5::State::FullscreenState);
return sendConfigure(maxSize, conf.states);
}
#ifdef QT_WAYLAND_COMPOSITOR_QUICK
-QWaylandQuickShellIntegration *QWaylandXdgSurface::createIntegration(QWaylandQuickShellSurfaceItem *item)
+QWaylandQuickShellIntegration *QWaylandXdgSurfaceV5::createIntegration(QWaylandQuickShellSurfaceItem *item)
{
- return new QtWayland::XdgShellIntegration(item);
+ return new QtWayland::XdgShellV5Integration(item);
}
#endif
/*!
- * \class QWaylandXdgPopup
+ * \class QWaylandXdgPopupV5
* \inmodule QtWaylandCompositor
* \preliminary
- * \brief The QWaylandXdgPopup class provides menus for an xdg surface
+ * \brief The QWaylandXdgPopupV5 class provides menus for an xdg surface
*
- * This class is part of the QWaylandXdgShell extension and provides a way to
+ * This class is part of the QWaylandXdgShellV5 extension and provides a way to
* extend the functionality of an existing QWaylandSurface with features
* specific to desktop-style menus for an xdg surface.
*
@@ -1018,20 +1018,20 @@ QWaylandQuickShellIntegration *QWaylandXdgSurface::createIntegration(QWaylandQui
*/
/*!
- * Constructs a QWaylandXdgPopup.
+ * Constructs a QWaylandXdgPopupV5.
*/
-QWaylandXdgPopup::QWaylandXdgPopup()
- : QWaylandShellSurfaceTemplate<QWaylandXdgPopup>(*new QWaylandXdgPopupPrivate)
+QWaylandXdgPopupV5::QWaylandXdgPopupV5()
+ : QWaylandShellSurfaceTemplate<QWaylandXdgPopupV5>(*new QWaylandXdgPopupV5Private)
{
}
/*!
- * Constructs a QWaylandXdgPopup for \a surface and initializes it with the
+ * Constructs a QWaylandXdgPopupV5 for \a surface and initializes it with the
* given \a parentSurface and \a resource.
*/
-QWaylandXdgPopup::QWaylandXdgPopup(QWaylandXdgShell *xdgShell, QWaylandSurface *surface,
+QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface,
QWaylandSurface *parentSurface, const QPoint &position, const QWaylandResource &resource)
- : QWaylandShellSurfaceTemplate<QWaylandXdgPopup>(*new QWaylandXdgPopupPrivate)
+ : QWaylandShellSurfaceTemplate<QWaylandXdgPopupV5>(*new QWaylandXdgPopupV5Private)
{
initialize(xdgShell, surface, parentSurface, position, resource);
}
@@ -1044,13 +1044,13 @@ QWaylandXdgPopup::QWaylandXdgPopup(QWaylandXdgShell *xdgShell, QWaylandSurface *
*/
/*!
- * Initializes the QWaylandXdgPopup, associating it with the given \a shell \a surface,
+ * Initializes the QWaylandXdgPopupV5, associating it with the given \a shell \a surface,
* \a parentSurface and \a resource.
*/
-void QWaylandXdgPopup::initialize(QWaylandXdgShell *shell, QWaylandSurface *surface, QWaylandSurface *parentSurface,
+void QWaylandXdgPopupV5::initialize(QWaylandXdgShellV5 *shell, QWaylandSurface *surface, QWaylandSurface *parentSurface,
const QPoint& position, const QWaylandResource &resource)
{
- Q_D(QWaylandXdgPopup);
+ Q_D(QWaylandXdgPopupV5);
d->m_surface = surface;
d->m_parentSurface = parentSurface;
d->m_xdgShell = shell;
@@ -1070,13 +1070,13 @@ void QWaylandXdgPopup::initialize(QWaylandXdgShell *shell, QWaylandSurface *surf
*/
/*!
- * \property QWaylandXdgPopup::shell
+ * \property QWaylandXdgPopupV5::shell
*
- * This property holds the shell associated with this QWaylandXdgPopup.
+ * This property holds the shell associated with this QWaylandXdgPopupV5.
*/
-QWaylandXdgShell *QWaylandXdgPopup::shell() const
+QWaylandXdgShellV5 *QWaylandXdgPopupV5::shell() const
{
- Q_D(const QWaylandXdgPopup);
+ Q_D(const QWaylandXdgPopupV5);
return d->m_xdgShell;
}
@@ -1087,13 +1087,13 @@ QWaylandXdgShell *QWaylandXdgPopup::shell() const
*/
/*!
- * \property QWaylandXdgPopup::surface
+ * \property QWaylandXdgPopupV5::surface
*
- * This property holds the surface associated with this QWaylandXdgPopup.
+ * This property holds the surface associated with this QWaylandXdgPopupV5.
*/
-QWaylandSurface *QWaylandXdgPopup::surface() const
+QWaylandSurface *QWaylandXdgPopupV5::surface() const
{
- Q_D(const QWaylandXdgPopup);
+ Q_D(const QWaylandXdgPopupV5);
return d->m_surface;
}
@@ -1104,14 +1104,14 @@ QWaylandSurface *QWaylandXdgPopup::surface() const
*/
/*!
- * \property QWaylandXdgPopup::parentSurface
+ * \property QWaylandXdgPopupV5::parentSurface
*
* This property holds the surface associated with the parent of this
- * QWaylandXdgPopup.
+ * QWaylandXdgPopupV5.
*/
-QWaylandSurface *QWaylandXdgPopup::parentSurface() const
+QWaylandSurface *QWaylandXdgPopupV5::parentSurface() const
{
- Q_D(const QWaylandXdgPopup);
+ Q_D(const QWaylandXdgPopupV5);
return d->m_parentSurface;
}
@@ -1125,65 +1125,65 @@ QWaylandSurface *QWaylandXdgPopup::parentSurface() const
*/
/*!
- * \property QWaylandXdgPopup::position
+ * \property QWaylandXdgPopupV5::position
*
* This property holds the location of the upper left corner of the surface
* relative to the upper left corner of the parent surface, in surface local
* coordinates.
*/
-QPoint QWaylandXdgPopup::position() const
+QPoint QWaylandXdgPopupV5::position() const
{
- Q_D(const QWaylandXdgPopup);
+ Q_D(const QWaylandXdgPopupV5);
return d->m_position;
}
/*!
* \internal
*/
-void QWaylandXdgPopup::initialize()
+void QWaylandXdgPopupV5::initialize()
{
QWaylandCompositorExtension::initialize();
}
/*!
- * Returns the Wayland interface for the QWaylandXdgPopup.
+ * Returns the Wayland interface for the QWaylandXdgPopupV5.
*/
-const wl_interface *QWaylandXdgPopup::interface()
+const wl_interface *QWaylandXdgPopupV5::interface()
{
- return QWaylandXdgPopupPrivate::interface();
+ return QWaylandXdgPopupV5Private::interface();
}
-QByteArray QWaylandXdgPopup::interfaceName()
+QByteArray QWaylandXdgPopupV5::interfaceName()
{
- return QWaylandXdgPopupPrivate::interfaceName();
+ return QWaylandXdgPopupV5Private::interfaceName();
}
/*!
- * Returns the surface role for the QWaylandXdgPopup.
+ * Returns the surface role for the QWaylandXdgPopupV5.
*/
-QWaylandSurfaceRole *QWaylandXdgPopup::role()
+QWaylandSurfaceRole *QWaylandXdgPopupV5::role()
{
- return &QWaylandXdgPopupPrivate::s_role;
+ return &QWaylandXdgPopupV5Private::s_role;
}
-QWaylandXdgPopup *QWaylandXdgPopup::fromResource(wl_resource *resource)
+QWaylandXdgPopupV5 *QWaylandXdgPopupV5::fromResource(wl_resource *resource)
{
- auto popupResource = QWaylandXdgPopupPrivate::Resource::fromResource(resource);
+ auto popupResource = QWaylandXdgPopupV5Private::Resource::fromResource(resource);
if (!popupResource)
return nullptr;
- return static_cast<QWaylandXdgPopupPrivate *>(popupResource->xdg_popup_object)->q_func();
+ return static_cast<QWaylandXdgPopupV5Private *>(popupResource->xdg_popup_object)->q_func();
}
-void QWaylandXdgPopup::sendPopupDone()
+void QWaylandXdgPopupV5::sendPopupDone()
{
- Q_D(QWaylandXdgPopup);
+ Q_D(QWaylandXdgPopupV5);
d->send_popup_done();
}
#ifdef QT_WAYLAND_COMPOSITOR_QUICK
-QWaylandQuickShellIntegration *QWaylandXdgPopup::createIntegration(QWaylandQuickShellSurfaceItem *item)
+QWaylandQuickShellIntegration *QWaylandXdgPopupV5::createIntegration(QWaylandQuickShellSurfaceItem *item)
{
- return new QtWayland::XdgPopupIntegration(item);
+ return new QtWayland::XdgPopupV5Integration(item);
}
#endif
diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshellv5.h
index 4a1ec5d06..c99f36282 100644
--- a/src/compositor/extensions/qwaylandxdgshell.h
+++ b/src/compositor/extensions/qwaylandxdgshellv5.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QWAYLANDXDGSHELL_H
-#define QWAYLANDXDGSHELL_H
+#ifndef QWAYLANDXDGSHELLV5_H
+#define QWAYLANDXDGSHELLV5_H
#include <QtWaylandCompositor/QWaylandCompositorExtension>
#include <QtWaylandCompositor/QWaylandResource>
@@ -47,11 +47,11 @@ struct wl_resource;
QT_BEGIN_NAMESPACE
-class QWaylandXdgShellPrivate;
-class QWaylandXdgSurface;
-class QWaylandXdgSurfacePrivate;
-class QWaylandXdgPopup;
-class QWaylandXdgPopupPrivate;
+class QWaylandXdgShellV5Private;
+class QWaylandXdgSurfaceV5;
+class QWaylandXdgSurfaceV5Private;
+class QWaylandXdgPopupV5;
+class QWaylandXdgPopupV5Private;
class QWaylandSurface;
class QWaylandSurfaceRole;
@@ -59,13 +59,13 @@ class QWaylandSeat;
class QWaylandOutput;
class QWaylandClient;
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShell : public QWaylandCompositorExtensionTemplate<QWaylandXdgShell>
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellV5 : public QWaylandCompositorExtensionTemplate<QWaylandXdgShellV5>
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QWaylandXdgShell)
+ Q_DECLARE_PRIVATE(QWaylandXdgShellV5)
public:
- QWaylandXdgShell();
- QWaylandXdgShell(QWaylandCompositor *compositor);
+ QWaylandXdgShellV5();
+ QWaylandXdgShellV5(QWaylandCompositor *compositor);
void initialize() Q_DECL_OVERRIDE;
@@ -78,8 +78,8 @@ public Q_SLOTS:
Q_SIGNALS:
void xdgSurfaceRequested(QWaylandSurface *surface, const QWaylandResource &resource);
- void xdgSurfaceCreated(QWaylandXdgSurface *xdgSurface);
- void xdgPopupCreated(QWaylandXdgPopup *xdgPopup);
+ void xdgSurfaceCreated(QWaylandXdgSurfaceV5 *xdgSurface);
+ void xdgPopupCreated(QWaylandXdgPopupV5 *xdgPopup);
void xdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandSeat *seat, const QPoint &position, const QWaylandResource &resource);
void pong(uint serial);
@@ -89,13 +89,13 @@ private Q_SLOTS:
};
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgSurface : public QWaylandShellSurfaceTemplate<QWaylandXdgSurface>
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgSurfaceV5 : public QWaylandShellSurfaceTemplate<QWaylandXdgSurfaceV5>
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QWaylandXdgSurface)
- Q_PROPERTY(QWaylandXdgShell *shell READ shell NOTIFY shellChanged)
+ Q_DECLARE_PRIVATE(QWaylandXdgSurfaceV5)
+ Q_PROPERTY(QWaylandXdgShellV5 *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
- Q_PROPERTY(QWaylandXdgSurface *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
+ Q_PROPERTY(QWaylandXdgSurfaceV5 *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QString appId READ appId NOTIFY appIdChanged)
Q_PROPERTY(QRect windowGeometry READ windowGeometry NOTIFY windowGeometryChanged)
@@ -128,10 +128,10 @@ public:
};
Q_ENUM(ResizeEdge)
- QWaylandXdgSurface();
- QWaylandXdgSurface(QWaylandXdgShell* xdgShell, QWaylandSurface *surface, const QWaylandResource &resource);
+ QWaylandXdgSurfaceV5();
+ QWaylandXdgSurfaceV5(QWaylandXdgShellV5* xdgShell, QWaylandSurface *surface, const QWaylandResource &resource);
- Q_INVOKABLE void initialize(QWaylandXdgShell* xdgShell, QWaylandSurface *surface, const QWaylandResource &resource);
+ Q_INVOKABLE void initialize(QWaylandXdgShellV5* xdgShell, QWaylandSurface *surface, const QWaylandResource &resource);
QString title() const;
QString appId() const;
@@ -142,15 +142,15 @@ public:
bool resizing() const;
bool activated() const;
- QWaylandXdgShell *shell() const;
+ QWaylandXdgShellV5 *shell() const;
QWaylandSurface *surface() const;
- QWaylandXdgSurface *parentSurface() const;
+ QWaylandXdgSurfaceV5 *parentSurface() const;
static const struct wl_interface *interface();
static QByteArray interfaceName();
static QWaylandSurfaceRole *role();
- static QWaylandXdgSurface *fromResource(::wl_resource *resource);
+ static QWaylandXdgSurfaceV5 *fromResource(::wl_resource *resource);
Q_INVOKABLE QSize sizeForResize(const QSizeF &size, const QPointF &delta, ResizeEdge edge);
Q_INVOKABLE uint sendConfigure(const QSize &size, const QVector<uint> &states);
@@ -201,26 +201,26 @@ private Q_SLOTS:
void handleBufferScaleChanged();
};
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopup : public QWaylandShellSurfaceTemplate<QWaylandXdgPopup>
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopupV5 : public QWaylandShellSurfaceTemplate<QWaylandXdgPopupV5>
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QWaylandXdgPopup)
- Q_PROPERTY(QWaylandXdgShell *shell READ shell NOTIFY shellChanged)
+ Q_DECLARE_PRIVATE(QWaylandXdgPopupV5)
+ Q_PROPERTY(QWaylandXdgShellV5 *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
Q_PROPERTY(QWaylandSurface *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
Q_PROPERTY(QPoint position READ position)
public:
- QWaylandXdgPopup();
- QWaylandXdgPopup(QWaylandXdgShell *xdgShell, QWaylandSurface *surface, QWaylandSurface *parentSurface,
+ QWaylandXdgPopupV5();
+ QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface, QWaylandSurface *parentSurface,
const QPoint &position, const QWaylandResource &resource);
Qt::WindowType windowType() const override { return Qt::WindowType::Popup; }
- Q_INVOKABLE void initialize(QWaylandXdgShell *shell, QWaylandSurface *surface,
+ Q_INVOKABLE void initialize(QWaylandXdgShellV5 *shell, QWaylandSurface *surface,
QWaylandSurface *parentSurface, const QPoint &position, const QWaylandResource &resource);
- QWaylandXdgShell *shell() const;
+ QWaylandXdgShellV5 *shell() const;
QWaylandSurface *surface() const;
QWaylandSurface *parentSurface() const;
@@ -229,7 +229,7 @@ public:
static const struct wl_interface *interface();
static QByteArray interfaceName();
static QWaylandSurfaceRole *role();
- static QWaylandXdgPopup *fromResource(::wl_resource *resource);
+ static QWaylandXdgPopupV5 *fromResource(::wl_resource *resource);
Q_INVOKABLE void sendPopupDone();
diff --git a/src/compositor/extensions/qwaylandxdgshell_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h
index d7244c704..31aa2112c 100644
--- a/src/compositor/extensions/qwaylandxdgshell_p.h
+++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h
@@ -34,13 +34,13 @@
**
****************************************************************************/
-#ifndef QWAYLANDXDGSHELL_P_H
-#define QWAYLANDXDGSHELL_P_H
+#ifndef QWAYLANDXDGSHELLV5_P_H
+#define QWAYLANDXDGSHELLV5_P_H
#include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
#include <QtWaylandCompositor/private/qwayland-server-xdg-shell.h>
-#include <QtWaylandCompositor/QWaylandXdgShell>
+#include <QtWaylandCompositor/QWaylandXdgShellV5>
#include <QtCore/QSet>
@@ -57,27 +57,27 @@
QT_BEGIN_NAMESPACE
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellPrivate
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellV5Private
: public QWaylandCompositorExtensionPrivate
, public QtWaylandServer::xdg_shell
{
- Q_DECLARE_PUBLIC(QWaylandXdgShell)
+ Q_DECLARE_PUBLIC(QWaylandXdgShellV5)
public:
- QWaylandXdgShellPrivate();
+ QWaylandXdgShellV5Private();
void ping(Resource *resource, uint32_t serial);
- void registerSurface(QWaylandXdgSurface *xdgSurface);
- void unregisterXdgSurface(QWaylandXdgSurface *xdgSurface);
- void registerXdgPopup(QWaylandXdgPopup *xdgPopup);
- void unregisterXdgPopup(QWaylandXdgPopup *xdgPopup);
- static QWaylandXdgShellPrivate *get(QWaylandXdgShell *xdgShell) { return xdgShell->d_func(); }
+ void registerSurface(QWaylandXdgSurfaceV5 *xdgSurface);
+ void unregisterXdgSurface(QWaylandXdgSurfaceV5 *xdgSurface);
+ void registerXdgPopup(QWaylandXdgPopupV5 *xdgPopup);
+ void unregisterXdgPopup(QWaylandXdgPopupV5 *xdgPopup);
+ static QWaylandXdgShellV5Private *get(QWaylandXdgShellV5 *xdgShell) { return xdgShell->d_func(); }
bool isValidPopupParent(QWaylandSurface *parentSurface) const;
- QWaylandXdgPopup *topmostPopupForClient(struct wl_client* client) const;
+ QWaylandXdgPopupV5 *topmostPopupForClient(struct wl_client* client) const;
QSet<uint32_t> m_pings;
- QMultiMap<struct wl_client *, QWaylandXdgSurface *> m_xdgSurfaces;
- QMultiMap<struct wl_client *, QWaylandXdgPopup *> m_xdgPopups;
+ QMultiMap<struct wl_client *, QWaylandXdgSurfaceV5 *> m_xdgSurfaces;
+ QMultiMap<struct wl_client *, QWaylandXdgPopupV5 *> m_xdgPopups;
- QWaylandXdgSurface *xdgSurfaceFromSurface(QWaylandSurface *surface);
+ QWaylandXdgSurfaceV5 *xdgSurfaceFromSurface(QWaylandSurface *surface);
protected:
void xdg_shell_destroy(Resource *resource) Q_DECL_OVERRIDE;
@@ -90,14 +90,14 @@ protected:
void xdg_shell_pong(Resource *resource, uint32_t serial) Q_DECL_OVERRIDE;
};
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgSurfacePrivate
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgSurfaceV5Private
: public QWaylandCompositorExtensionPrivate
, public QtWaylandServer::xdg_surface
{
- Q_DECLARE_PUBLIC(QWaylandXdgSurface)
+ Q_DECLARE_PUBLIC(QWaylandXdgSurfaceV5)
public:
- QWaylandXdgSurfacePrivate();
- static QWaylandXdgSurfacePrivate *get(QWaylandXdgSurface *xdgSurface) { return xdgSurface->d_func(); }
+ QWaylandXdgSurfaceV5Private();
+ static QWaylandXdgSurfaceV5Private *get(QWaylandXdgSurfaceV5 *xdgSurface) { return xdgSurface->d_func(); }
enum WindowType {
UnknownWindowType,
@@ -117,9 +117,9 @@ public:
void updateFallbackWindowGeometry();
private:
- QWaylandXdgShell *m_xdgShell;
+ QWaylandXdgShellV5 *m_xdgShell;
QWaylandSurface *m_surface;
- QWaylandXdgSurface *m_parentSurface;
+ QWaylandXdgSurfaceV5 *m_parentSurface;
WindowType m_windowType;
@@ -157,19 +157,19 @@ private:
static QWaylandSurfaceRole s_role;
};
-class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopupPrivate
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopupV5Private
: public QWaylandCompositorExtensionPrivate
, public QtWaylandServer::xdg_popup
{
- Q_DECLARE_PUBLIC(QWaylandXdgPopup)
+ Q_DECLARE_PUBLIC(QWaylandXdgPopupV5)
public:
- QWaylandXdgPopupPrivate();
- static QWaylandXdgPopupPrivate *get(QWaylandXdgPopup *xdgPopup) { return xdgPopup->d_func(); }
+ QWaylandXdgPopupV5Private();
+ static QWaylandXdgPopupV5Private *get(QWaylandXdgPopupV5 *xdgPopup) { return xdgPopup->d_func(); }
QWaylandSurface *m_surface;
QWaylandSurface *m_parentSurface;
- QWaylandXdgShell *m_xdgShell;
+ QWaylandXdgShellV5 *m_xdgShell;
QPoint m_position;
void xdg_popup_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
diff --git a/src/compositor/extensions/qwaylandxdgshellintegration.cpp b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
index 90c7a7b36..768747e44 100644
--- a/src/compositor/extensions/qwaylandxdgshellintegration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
@@ -34,12 +34,12 @@
**
****************************************************************************/
-#include "qwaylandxdgshellintegration_p.h"
+#include "qwaylandxdgshellv5integration_p.h"
#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem>
#include <QtWaylandCompositor/QWaylandCompositor>
#include <QtWaylandCompositor/QWaylandSeat>
-#include <QtWaylandCompositor/private/qwaylandxdgshell_p.h>
+#include <QtWaylandCompositor/private/qwaylandxdgshellv5_p.h>
#include <QMouseEvent>
#include <QGuiApplication>
@@ -47,23 +47,23 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
-XdgShellIntegration::XdgShellIntegration(QWaylandQuickShellSurfaceItem *item)
+XdgShellV5Integration::XdgShellV5Integration(QWaylandQuickShellSurfaceItem *item)
: QWaylandQuickShellIntegration(item)
, m_item(item)
- , m_xdgSurface(qobject_cast<QWaylandXdgSurface *>(item->shellSurface()))
+ , m_xdgSurface(qobject_cast<QWaylandXdgSurfaceV5 *>(item->shellSurface()))
, grabberState(GrabberState::Default)
{
m_item->setSurface(m_xdgSurface->surface());
- connect(m_xdgSurface, &QWaylandXdgSurface::startMove, this, &XdgShellIntegration::handleStartMove);
- connect(m_xdgSurface, &QWaylandXdgSurface::startResize, this, &XdgShellIntegration::handleStartResize);
- connect(m_xdgSurface, &QWaylandXdgSurface::setMaximized, this, &XdgShellIntegration::handleSetMaximized);
- connect(m_xdgSurface, &QWaylandXdgSurface::unsetMaximized, this, &XdgShellIntegration::handleUnsetMaximized);
- connect(m_xdgSurface, &QWaylandXdgSurface::maximizedChanged, this, &XdgShellIntegration::handleMaximizedChanged);
- connect(m_xdgSurface, &QWaylandXdgSurface::activatedChanged, this, &XdgShellIntegration::handleActivatedChanged);
- connect(m_xdgSurface->surface(), &QWaylandSurface::sizeChanged, this, &XdgShellIntegration::handleSurfaceSizeChanged);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::startMove, this, &XdgShellV5Integration::handleStartMove);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::startResize, this, &XdgShellV5Integration::handleStartResize);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::setMaximized, this, &XdgShellV5Integration::handleSetMaximized);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::unsetMaximized, this, &XdgShellV5Integration::handleUnsetMaximized);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::maximizedChanged, this, &XdgShellV5Integration::handleMaximizedChanged);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::activatedChanged, this, &XdgShellV5Integration::handleActivatedChanged);
+ connect(m_xdgSurface->surface(), &QWaylandSurface::sizeChanged, this, &XdgShellV5Integration::handleSurfaceSizeChanged);
}
-bool XdgShellIntegration::mouseMoveEvent(QMouseEvent *event)
+bool XdgShellV5Integration::mouseMoveEvent(QMouseEvent *event)
{
if (grabberState == GrabberState::Resize) {
Q_ASSERT(resizeState.seat == m_item->compositor()->seatFor(event));
@@ -91,7 +91,7 @@ bool XdgShellIntegration::mouseMoveEvent(QMouseEvent *event)
return false;
}
-bool XdgShellIntegration::mouseReleaseEvent(QMouseEvent *event)
+bool XdgShellV5Integration::mouseReleaseEvent(QMouseEvent *event)
{
Q_UNUSED(event);
@@ -106,14 +106,14 @@ bool XdgShellIntegration::mouseReleaseEvent(QMouseEvent *event)
return false;
}
-void XdgShellIntegration::handleStartMove(QWaylandSeat *seat)
+void XdgShellV5Integration::handleStartMove(QWaylandSeat *seat)
{
grabberState = GrabberState::Move;
moveState.seat = seat;
moveState.initialized = false;
}
-void XdgShellIntegration::handleStartResize(QWaylandSeat *seat, QWaylandXdgSurface::ResizeEdge edges)
+void XdgShellV5Integration::handleStartResize(QWaylandSeat *seat, QWaylandXdgSurfaceV5::ResizeEdge edges)
{
grabberState = GrabberState::Resize;
resizeState.seat = seat;
@@ -124,7 +124,7 @@ void XdgShellIntegration::handleStartResize(QWaylandSeat *seat, QWaylandXdgSurfa
resizeState.initialized = false;
}
-void XdgShellIntegration::handleSetMaximized()
+void XdgShellV5Integration::handleSetMaximized()
{
maximizeState.initialWindowSize = m_xdgSurface->windowGeometry().size();
maximizeState.initialPosition = m_item->moveItem()->position();
@@ -133,12 +133,12 @@ void XdgShellIntegration::handleSetMaximized()
m_xdgSurface->sendMaximized(output->availableGeometry().size() / output->scaleFactor());
}
-void XdgShellIntegration::handleUnsetMaximized()
+void XdgShellV5Integration::handleUnsetMaximized()
{
m_xdgSurface->sendUnmaximized(maximizeState.initialWindowSize);
}
-void XdgShellIntegration::handleMaximizedChanged()
+void XdgShellV5Integration::handleMaximizedChanged()
{
if (m_xdgSurface->maximized()) {
QWaylandOutput *output = m_item->view()->output();
@@ -148,30 +148,30 @@ void XdgShellIntegration::handleMaximizedChanged()
}
}
-void XdgShellIntegration::handleActivatedChanged()
+void XdgShellV5Integration::handleActivatedChanged()
{
if (m_xdgSurface->activated())
m_item->raise();
}
-void XdgShellIntegration::handleSurfaceSizeChanged()
+void XdgShellV5Integration::handleSurfaceSizeChanged()
{
if (grabberState == GrabberState::Resize) {
qreal x = resizeState.initialPosition.x();
qreal y = resizeState.initialPosition.y();
- if (resizeState.resizeEdges & QWaylandXdgSurface::ResizeEdge::TopEdge)
+ if (resizeState.resizeEdges & QWaylandXdgSurfaceV5::ResizeEdge::TopEdge)
y += resizeState.initialSurfaceSize.height() - m_item->surface()->size().height();
- if (resizeState.resizeEdges & QWaylandXdgSurface::ResizeEdge::LeftEdge)
+ if (resizeState.resizeEdges & QWaylandXdgSurfaceV5::ResizeEdge::LeftEdge)
x += resizeState.initialSurfaceSize.width() - m_item->surface()->size().width();
m_item->moveItem()->setPosition(QPointF(x, y));
}
}
-XdgPopupIntegration::XdgPopupIntegration(QWaylandQuickShellSurfaceItem *item)
+XdgPopupV5Integration::XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item)
: QWaylandQuickShellIntegration (item)
- , m_xdgPopup(qobject_cast<QWaylandXdgPopup *>(item->shellSurface()))
- , m_xdgShell(QWaylandXdgPopupPrivate::get(m_xdgPopup)->m_xdgShell)
+ , m_xdgPopup(qobject_cast<QWaylandXdgPopupV5 *>(item->shellSurface()))
+ , m_xdgShell(QWaylandXdgPopupV5Private::get(m_xdgPopup)->m_xdgShell)
{
item->setSurface(m_xdgPopup->surface());
item->moveItem()->setPosition(QPointF(m_xdgPopup->position() * item->view()->output()->scaleFactor()));
@@ -179,12 +179,12 @@ XdgPopupIntegration::XdgPopupIntegration(QWaylandQuickShellSurfaceItem *item)
QWaylandClient *client = m_xdgPopup->surface()->client();
QWaylandQuickShellEventFilter::startFilter(client, [&]() { m_xdgShell->closeAllPopups(); });
- connect(m_xdgPopup, &QWaylandXdgPopup::destroyed, this, &XdgPopupIntegration::handlePopupDestroyed);
+ connect(m_xdgPopup, &QWaylandXdgPopupV5::destroyed, this, &XdgPopupV5Integration::handlePopupDestroyed);
}
-void XdgPopupIntegration::handlePopupDestroyed()
+void XdgPopupV5Integration::handlePopupDestroyed()
{
- QWaylandXdgShellPrivate *shellPrivate = QWaylandXdgShellPrivate::get(m_xdgShell);
+ QWaylandXdgShellV5Private *shellPrivate = QWaylandXdgShellV5Private::get(m_xdgShell);
auto popups = shellPrivate->m_xdgPopups;
if (popups.isEmpty())
QWaylandQuickShellEventFilter::cancelFilter();
diff --git a/src/compositor/extensions/qwaylandxdgshellintegration_p.h b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h
index 8a000ff6a..61db435e5 100644
--- a/src/compositor/extensions/qwaylandxdgshellintegration_p.h
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h
@@ -34,11 +34,11 @@
**
****************************************************************************/
-#ifndef QWAYLANDXDGSHELLINTEGRATION_H
-#define QWAYLANDXDGSHELLINTEGRATION_H
+#ifndef QWAYLANDXDGSHELLV5INTEGRATION_H
+#define QWAYLANDXDGSHELLV5INTEGRATION_H
#include <QtWaylandCompositor/private/qwaylandquickshellsurfaceitem_p.h>
-#include <QtWaylandCompositor/QWaylandXdgSurface>
+#include <QtWaylandCompositor/QWaylandXdgSurfaceV5>
QT_BEGIN_NAMESPACE
@@ -55,17 +55,17 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
-class XdgShellIntegration : public QWaylandQuickShellIntegration
+class XdgShellV5Integration : public QWaylandQuickShellIntegration
{
Q_OBJECT
public:
- XdgShellIntegration(QWaylandQuickShellSurfaceItem *item);
+ XdgShellV5Integration(QWaylandQuickShellSurfaceItem *item);
bool mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
bool mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
private Q_SLOTS:
void handleStartMove(QWaylandSeat *seat);
- void handleStartResize(QWaylandSeat *seat, QWaylandXdgSurface::ResizeEdge edges);
+ void handleStartResize(QWaylandSeat *seat, QWaylandXdgSurfaceV5::ResizeEdge edges);
void handleSetMaximized();
void handleUnsetMaximized();
void handleMaximizedChanged();
@@ -79,7 +79,7 @@ private:
Move
};
QWaylandQuickShellSurfaceItem *m_item;
- QWaylandXdgSurface *m_xdgSurface;
+ QWaylandXdgSurfaceV5 *m_xdgSurface;
GrabberState grabberState;
struct {
@@ -90,7 +90,7 @@ private:
struct {
QWaylandSeat *seat;
- QWaylandXdgSurface::ResizeEdge resizeEdges;
+ QWaylandXdgSurfaceV5::ResizeEdge resizeEdges;
QSizeF initialWindowSize;
QPointF initialMousePos;
QPointF initialPosition;
@@ -104,18 +104,18 @@ private:
} maximizeState;
};
-class XdgPopupIntegration : public QWaylandQuickShellIntegration
+class XdgPopupV5Integration : public QWaylandQuickShellIntegration
{
Q_OBJECT
public:
- XdgPopupIntegration(QWaylandQuickShellSurfaceItem *item);
+ XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item);
private Q_SLOTS:
void handlePopupDestroyed();
private:
- QWaylandXdgPopup *m_xdgPopup;
- QWaylandXdgShell *m_xdgShell;
+ QWaylandXdgPopupV5 *m_xdgPopup;
+ QWaylandXdgShellV5 *m_xdgShell;
};
}
diff --git a/src/imports/compositor/plugins.qmltypes b/src/imports/compositor/plugins.qmltypes
index 4c7cd7aa5..efeca304c 100644
--- a/src/imports/compositor/plugins.qmltypes
+++ b/src/imports/compositor/plugins.qmltypes
@@ -519,7 +519,7 @@ Module {
Method { name: "sendPopupDone" }
}
Component {
- name: "QWaylandXdgShell"
+ name: "QWaylandXdgShellV5"
prototype: "QWaylandCompositorExtension"
Signal {
name: "xdgSurfaceRequested"
@@ -528,11 +528,11 @@ Module {
}
Signal {
name: "xdgSurfaceCreated"
- Parameter { name: "xdgSurface"; type: "QWaylandXdgSurface"; isPointer: true }
+ Parameter { name: "xdgSurface"; type: "QWaylandXdgSurfaceV5"; isPointer: true }
}
Signal {
name: "xdgPopupCreated"
- Parameter { name: "xdgPopup"; type: "QWaylandXdgPopup"; isPointer: true }
+ Parameter { name: "xdgPopup"; type: "QWaylandXdgPopupV5"; isPointer: true }
}
Signal {
name: "xdgPopupRequested"
@@ -554,15 +554,15 @@ Module {
Method { name: "closeAllPopups" }
}
Component {
- name: "QWaylandXdgShellQuickExtension"
+ name: "QWaylandXdgShellV5QuickExtension"
defaultProperty: "data"
- prototype: "QWaylandXdgShell"
+ prototype: "QWaylandXdgShellV5"
exports: ["QtWayland.Compositor/XdgShell 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
}
Component {
- name: "QWaylandXdgSurface"
+ name: "QWaylandXdgSurfaceV5"
prototype: "QWaylandShellSurface"
exports: ["QtWayland.Compositor/XdgSurface 1.0"]
exportMetaObjectRevisions: [0]
@@ -590,7 +590,7 @@ Module {
}
}
Property { name: "surface"; type: "QWaylandSurface"; isReadonly: true; isPointer: true }
- Property { name: "parentSurface"; type: "QWaylandXdgSurface"; isReadonly: true; isPointer: true }
+ Property { name: "parentSurface"; type: "QWaylandXdgSurfaceV5"; isReadonly: true; isPointer: true }
Property { name: "title"; type: "string"; isReadonly: true }
Property { name: "appId"; type: "string"; isReadonly: true }
Property { name: "windowGeometry"; type: "QRect"; isReadonly: true }
@@ -629,7 +629,7 @@ Module {
}
Method {
name: "initialize"
- Parameter { name: "xdgShell"; type: "QWaylandXdgShell"; isPointer: true }
+ Parameter { name: "xdgShell"; type: "QWaylandXdgShellV5"; isPointer: true }
Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
Parameter { name: "resource"; type: "QWaylandResource" }
}
diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
index 894a3e28f..45b46a811 100644
--- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp
+++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
@@ -54,7 +54,7 @@
#include <QtWaylandCompositor/QWaylandQtWindowManager>
#include <QtWaylandCompositor/QWaylandWlShell>
#include <QtWaylandCompositor/QWaylandTextInputManager>
-#include <QtWaylandCompositor/QWaylandXdgShell>
+#include <QtWaylandCompositor/QWaylandXdgShellV5>
#include <QtWaylandCompositor/qwaylandexport.h>
#include "qwaylandmousetracker_p.h"
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(QWaylandQuickCompositor)
Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtWindowManager)
Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWlShell)
-Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShell)
+Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShellV5)
Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandTextInputManager)
class QmlUrlResolver
@@ -133,8 +133,8 @@ public:
qmlRegisterType<QWaylandWlShellQuickExtension>(uri, 1, 0, "WlShell");
qmlRegisterType<QWaylandWlShellSurface>(uri, 1, 0, "WlShellSurface");
qmlRegisterType<QWaylandQuickShellSurfaceItem>(uri, 1, 0, "ShellSurfaceItem");
- qmlRegisterType<QWaylandXdgShellQuickExtension>(uri, 1, 0, "XdgShell");
- qmlRegisterType<QWaylandXdgSurface>(uri, 1, 0, "XdgSurface");
+ qmlRegisterType<QWaylandXdgShellV5QuickExtension>(uri, 1, 0, "XdgShellV5");
+ qmlRegisterType<QWaylandXdgSurfaceV5>(uri, 1, 0, "XdgSurfaceV5");
qmlRegisterType<QWaylandTextInputManagerQuickExtension>(uri, 1, 0, "TextInputManager");
}
};
diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp
index 05e876dd0..ef076001b 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -35,7 +35,7 @@
#include "qwaylandbufferref.h"
#include "qwaylandseat.h"
-#include <QtWaylandCompositor/QWaylandXdgShell>
+#include <QtWaylandCompositor/QWaylandXdgShellV5>
#include <QtWaylandCompositor/QWaylandSurface>
#include <QtWaylandCompositor/QWaylandResource>
#include <qwayland-xdg-shell.h>
@@ -379,7 +379,7 @@ class XdgTestCompositor: public TestCompositor {
Q_OBJECT
public:
XdgTestCompositor() : xdgShell(this) {}
- QWaylandXdgShell xdgShell;
+ QWaylandXdgShellV5 xdgShell;
};
void tst_WaylandCompositor::advertisesXdgShellSupport()
@@ -399,9 +399,9 @@ void tst_WaylandCompositor::createsXdgSurfaces()
MockClient client;
QTRY_VERIFY(&client.xdgShell);
- QSignalSpy xdgSurfaceCreatedSpy(&compositor.xdgShell, &QWaylandXdgShell::xdgSurfaceCreated);
- QWaylandXdgSurface *xdgSurface = nullptr;
- QObject::connect(&compositor.xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, [&](QWaylandXdgSurface *s) {
+ QSignalSpy xdgSurfaceCreatedSpy(&compositor.xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated);
+ QWaylandXdgSurfaceV5 *xdgSurface = nullptr;
+ QObject::connect(&compositor.xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, [&](QWaylandXdgSurfaceV5 *s) {
xdgSurface = s;
});
@@ -417,8 +417,8 @@ void tst_WaylandCompositor::reportsXdgSurfaceWindowGeometry()
XdgTestCompositor compositor;
compositor.create();
- QWaylandXdgSurface *xdgSurface = nullptr;
- QObject::connect(&compositor.xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, [&](QWaylandXdgSurface *s) {
+ QWaylandXdgSurfaceV5 *xdgSurface = nullptr;
+ QObject::connect(&compositor.xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, [&](QWaylandXdgSurfaceV5 *s) {
xdgSurface = s;
});
@@ -445,8 +445,8 @@ void tst_WaylandCompositor::setsXdgAppId()
XdgTestCompositor compositor;
compositor.create();
- QWaylandXdgSurface *xdgSurface = nullptr;
- QObject::connect(&compositor.xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, [&](QWaylandXdgSurface *s) {
+ QWaylandXdgSurfaceV5 *xdgSurface = nullptr;
+ QObject::connect(&compositor.xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, [&](QWaylandXdgSurfaceV5 *s) {
xdgSurface = s;
});
@@ -487,8 +487,8 @@ void tst_WaylandCompositor::sendsXdgConfigure()
XdgTestCompositor compositor;
compositor.create();
- QWaylandXdgSurface *xdgSurface = nullptr;
- QObject::connect(&compositor.xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, [&](QWaylandXdgSurface *s) {
+ QWaylandXdgSurfaceV5 *xdgSurface = nullptr;
+ QObject::connect(&compositor.xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, [&](QWaylandXdgSurfaceV5 *s) {
xdgSurface = s;
});
@@ -503,15 +503,15 @@ void tst_WaylandCompositor::sendsXdgConfigure()
QTRY_VERIFY(!xdgSurface->fullscreen());
QTRY_VERIFY(!xdgSurface->resizing());
- xdgSurface->sendConfigure(QSize(10, 20), QVector<QWaylandXdgSurface::State>{QWaylandXdgSurface::State::ActivatedState});
+ xdgSurface->sendConfigure(QSize(10, 20), QVector<QWaylandXdgSurfaceV5::State>{QWaylandXdgSurfaceV5::State::ActivatedState});
compositor.flushClients();
- QTRY_COMPARE(mockXdgSurface.configureStates, QList<uint>{QWaylandXdgSurface::State::ActivatedState});
+ QTRY_COMPARE(mockXdgSurface.configureStates, QList<uint>{QWaylandXdgSurfaceV5::State::ActivatedState});
QTRY_COMPARE(mockXdgSurface.configureSize, QSize(10, 20));
xdgSurface->sendMaximized(QSize(800, 600));
compositor.flushClients();
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::MaximizedState));
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::MaximizedState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
QTRY_COMPARE(mockXdgSurface.configureSize, QSize(800, 600));
// There hasn't been any ack_configures, so state should still be unchanged
@@ -525,8 +525,8 @@ void tst_WaylandCompositor::sendsXdgConfigure()
xdgSurface->sendUnmaximized();
compositor.flushClients();
- QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::MaximizedState));
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
+ QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::MaximizedState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
QTRY_COMPARE(mockXdgSurface.configureSize, QSize(0, 0));
// The unmaximized configure hasn't been acked, so maximized should still be true
@@ -535,32 +535,32 @@ void tst_WaylandCompositor::sendsXdgConfigure()
xdgSurface->sendResizing(QSize(800, 600));
compositor.flushClients();
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ResizingState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ResizingState));
QTRY_COMPARE(mockXdgSurface.configureSize, QSize(800, 600));
xdgSurface->sendFullscreen(QSize(1024, 768));
compositor.flushClients();
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::FullscreenState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::FullscreenState));
QTRY_COMPARE(mockXdgSurface.configureSize, QSize(1024, 768));
uint fullscreenSerial = mockXdgSurface.configureSerial;
xdgSurface->sendUnmaximized();
compositor.flushClients();
- QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
- QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::FullscreenState));
+ QTRY_VERIFY(mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
+ QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::FullscreenState));
- xdgSurface->sendConfigure(QSize(0, 0), QVector<QWaylandXdgSurface::State>{});
+ xdgSurface->sendConfigure(QSize(0, 0), QVector<QWaylandXdgSurfaceV5::State>{});
compositor.flushClients();
- QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
+ QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
xdgSurface->sendMaximized(QSize(800, 600));
compositor.flushClients();
- QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::ActivatedState));
+ QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::ActivatedState));
xdgSurface->sendFullscreen(QSize(800, 600));
compositor.flushClients();
- QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurface::State::MaximizedState));
+ QTRY_VERIFY(!mockXdgSurface.configureStates.contains(QWaylandXdgSurfaceV5::State::MaximizedState));
// Verify that acking a configure that's not the most recently sent works
xdg_surface_ack_configure(clientXdgSurface, fullscreenSerial);