summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Redondo <qt@david-redondo.de>2024-01-31 12:06:16 +0100
committerDavid Redondo <qt@david-redondo.de>2024-02-02 14:30:15 +0100
commitf61e39ac0e3a50db088c145c5d04395044db958c (patch)
tree6da88c58850d4ad14c3ccaff5d05cfd8b7de83f8 /src/client
parent9e1e6665511dcfae24eea43c63f03f91c17521cc (diff)
client: Switch qt-toplevel-drag to xdg-toplevel-drag
While no released compositor implemented qt-toplevel-drag it was a valuable to step to prove the protocol and the Qt implementation together with development pre-release versions of KWin. Now that the protocol is standardized we can switch to that version which is functionally identical. Pick-to: 6.6 6.7 Change-Id: I3beefe542cbabeddba4468b5d1fa24fcb05a2e5a Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/CMakeLists.txt2
-rw-r--r--src/client/qwaylanddatadevice.cpp6
-rw-r--r--src/client/qwaylanddatadevice_p.h4
-rw-r--r--src/client/qwaylanddisplay.cpp8
-rw-r--r--src/client/qwaylanddisplay_p.h12
5 files changed, 17 insertions, 15 deletions
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 67ee5c865..6d986ce8b 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -94,8 +94,8 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-output-unstable-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/fractional-scale-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/viewporter.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/qt-toplevel-drag-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-shell.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-toplevel-drag-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-key-unstable-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-text-input-method-unstable-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-windowmanager.xml
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
index dd5e62cd0..a59b201f6 100644
--- a/src/client/qwaylanddatadevice.cpp
+++ b/src/client/qwaylanddatadevice.cpp
@@ -13,7 +13,7 @@
#include "qwaylandabstractdecoration_p.h"
#include "qwaylandsurface_p.h"
-#include <QtWaylandClient/private/qwayland-qt-toplevel-drag-v1.h>
+#include <QtWaylandClient/private/qwayland-xdg-toplevel-drag-v1.h>
#include <QtCore/QMimeData>
#include <QtGui/QGuiApplication>
@@ -153,8 +153,8 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte
offsetStream >> offset;
if (auto waylandWindow = static_cast<QWaylandWindow *>(dockWindow->handle())) {
if (auto toplevel = waylandWindow->surfaceRole<xdg_toplevel>()) {
- m_toplevelDrag = new QtWayland::qt_toplevel_drag_v1(
- m_display->xdgToplevelDragManager()->get_qt_toplevel_drag(
+ m_toplevelDrag = new QtWayland::xdg_toplevel_drag_v1(
+ m_display->xdgToplevelDragManager()->get_xdg_toplevel_drag(
m_dragSource->object()));
m_toplevelDrag->attach(toplevel, offset.x(), offset.y());
}
diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h
index b924aa7ef..3dc4fcaf6 100644
--- a/src/client/qwaylanddatadevice_p.h
+++ b/src/client/qwaylanddatadevice_p.h
@@ -32,7 +32,7 @@ class QPlatformDragQtResponse;
class QWindow;
namespace QtWayland {
-class qt_toplevel_drag_v1;
+class xdg_toplevel_drag_v1;
}
namespace QtWaylandClient {
@@ -98,7 +98,7 @@ private:
QScopedPointer<QWaylandDataOffer> m_selectionOffer;
QScopedPointer<QWaylandDataSource> m_selectionSource;
QScopedPointer<QWaylandDataSource> m_dragSource;
- QtWayland::qt_toplevel_drag_v1 *m_toplevelDrag = nullptr;
+ QtWayland::xdg_toplevel_drag_v1 *m_toplevelDrag = nullptr;
};
}
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 797013970..da29980c7 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -51,7 +51,7 @@
#include <QtWaylandClient/private/qwayland-fractional-scale-v1.h>
#include <QtWaylandClient/private/qwayland-viewporter.h>
#include <QtWaylandClient/private/qwayland-cursor-shape-v1.h>
-#include <QtWaylandClient/private/qwayland-qt-toplevel-drag-v1.h>
+#include <QtWaylandClient/private/qwayland-xdg-toplevel-drag-v1.h>
#include <QtCore/private/qcore_unix_p.h>
@@ -773,10 +773,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
wp_cursor_shape_manager_v1_destroy>(
registry, id, std::min(1u, version)));
} else if (
- interface == QLatin1String(QtWayland::qt_toplevel_drag_manager_v1::interface()->name)) {
+ interface == QLatin1String(QtWayland::xdg_toplevel_drag_manager_v1::interface()->name)) {
mGlobals.xdgToplevelDragManager.reset(
- new WithDestructor<QtWayland::qt_toplevel_drag_manager_v1,
- qt_toplevel_drag_manager_v1_destroy>(registry, id, 1));
+ new WithDestructor<QtWayland::xdg_toplevel_drag_manager_v1,
+ xdg_toplevel_drag_manager_v1_destroy>(registry, id, 1));
}
mRegistryGlobals.append(RegistryGlobal(id, interface, version, registry));
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index e647f41c0..234524925 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -54,7 +54,7 @@ namespace QtWayland {
class wp_cursor_shape_manager_v1;
class wp_fractional_scale_manager_v1;
class wp_viewporter;
- class qt_toplevel_drag_manager_v1;
+ class xdg_toplevel_drag_manager_v1;
}
namespace QtWaylandClient {
@@ -125,7 +125,10 @@ public:
QWaylandCursor *waylandCursor();
QWaylandCursorTheme *loadCursorTheme(const QString &name, int pixelSize);
#endif
- struct wl_display *wl_display() const { return mDisplay; }
+ struct wl_display *wl_display() const
+ {
+ return mDisplay;
+ }
struct ::wl_registry *wl_registry() { return object(); }
QtWayland::wl_compositor *compositor()
@@ -202,7 +205,7 @@ public:
{
return mGlobals.cursorShapeManager.get();
}
- QtWayland::qt_toplevel_drag_manager_v1 *xdgToplevelDragManager() const
+ QtWayland::xdg_toplevel_drag_manager_v1 *xdgToplevelDragManager() const
{
return mGlobals.xdgToplevelDragManager.get();
}
@@ -281,7 +284,6 @@ private:
RegistryListener listener = nullptr;
void *data = nullptr;
};
-
struct wl_display *mDisplay = nullptr;
std::unique_ptr<EventThread> m_eventThread;
wl_event_queue *m_frameEventQueue = nullptr;
@@ -341,7 +343,7 @@ private:
std::unique_ptr<QtWayland::wp_viewporter> viewporter;
std::unique_ptr<QtWayland::wp_fractional_scale_manager_v1> fractionalScaleManager;
std::unique_ptr<QtWayland::wp_cursor_shape_manager_v1> cursorShapeManager;
- std::unique_ptr<QtWayland::qt_toplevel_drag_manager_v1> xdgToplevelDragManager;
+ std::unique_ptr<QtWayland::xdg_toplevel_drag_manager_v1> xdgToplevelDragManager;
} mGlobals;
int mFd = -1;
int mWritableNotificationFd = -1;