summaryrefslogtreecommitdiffstats
path: root/src/compositor
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-09-12 14:17:43 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-09-18 12:13:30 +0000
commit54113bb70ccc2df74c55d881b543d13fd4eb9550 (patch)
tree0ecc667fa05df3d03f266fe55a0030c2a3d181a3 /src/compositor
parentae4326db18b99630766e73c2f873eb883db2f493 (diff)
Don't use members of wl_resource
When we switch to only including core wayland headers, wl_resource will be an opaque type. Use the getters and setter functions instead. Task-number: QTBUG-70553 Change-Id: I7d84d48a4ee3586f231a331cd15716686dcee775 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp2
-rw-r--r--src/compositor/extensions/pregenerated/3rdparty/qwayland-server-xdg-shell-unstable-v5_p.h6
-rw-r--r--src/compositor/wayland_wrapper/qwlbuffermanager.cpp2
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager.cpp4
-rw-r--r--src/compositor/wayland_wrapper/qwlregion_p.h2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index aa3b49b7a..e067eeafe 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -92,7 +92,7 @@ void QWaylandKeyboardPrivate::checkFocusResource(Resource *keyboardResource)
return;
// check if new wl_keyboard resource is from the client owning the focus surface
- if (focus->resource()->client == keyboardResource->client()) {
+ if (wl_resource_get_client(focus->resource()) == keyboardResource->client()) {
sendEnter(focus, keyboardResource);
focusResource = keyboardResource;
}
diff --git a/src/compositor/extensions/pregenerated/3rdparty/qwayland-server-xdg-shell-unstable-v5_p.h b/src/compositor/extensions/pregenerated/3rdparty/qwayland-server-xdg-shell-unstable-v5_p.h
index dfd42535e..63817a5e3 100644
--- a/src/compositor/extensions/pregenerated/3rdparty/qwayland-server-xdg-shell-unstable-v5_p.h
+++ b/src/compositor/extensions/pregenerated/3rdparty/qwayland-server-xdg-shell-unstable-v5_p.h
@@ -73,7 +73,7 @@ namespace QtWaylandServer {
xdg_shell_v5 *xdg_shell_object;
struct ::wl_resource *handle;
- struct ::wl_client *client() const { return handle->client; }
+ struct ::wl_client *client() const { return wl_resource_get_client(handle); }
int version() const { return wl_resource_get_version(handle); }
static Resource *fromResource(struct ::wl_resource *resource);
@@ -193,7 +193,7 @@ namespace QtWaylandServer {
xdg_surface_v5 *xdg_surface_object;
struct ::wl_resource *handle;
- struct ::wl_client *client() const { return handle->client; }
+ struct ::wl_client *client() const { return wl_resource_get_client(handle); }
int version() const { return wl_resource_get_version(handle); }
static Resource *fromResource(struct ::wl_resource *resource);
@@ -366,7 +366,7 @@ namespace QtWaylandServer {
xdg_popup_v5 *xdg_popup_object;
struct ::wl_resource *handle;
- struct ::wl_client *client() const { return handle->client; }
+ struct ::wl_client *client() const { return wl_resource_get_client(handle); }
int version() const { return wl_resource_get_version(handle); }
static Resource *fromResource(struct ::wl_resource *resource);
diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
index d5c661e93..b4f3d6822 100644
--- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
+++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
@@ -84,7 +84,7 @@ ClientBuffer *BufferManager::getBuffer(wl_resource *buffer_resource)
auto *destroy_listener = new buffer_manager_destroy_listener;
destroy_listener->d = this;
- wl_signal_add(&buffer_resource->destroy_signal, destroy_listener);
+ wl_resource_add_destroy_listener(buffer_resource, destroy_listener);
return newBuffer;
}
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
index de62ffc3b..e30bc84f8 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
@@ -210,7 +210,7 @@ bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDevic
if (!m_compositorOwnsSelection)
return false;
- wl_client *client = clientDataDeviceResource->client;
+ wl_client *client = wl_resource_get_client(clientDataDeviceResource);
//qDebug("compositor offers %d types to %p", m_retainedData.formats().count(), client);
struct wl_resource *selectionOffer =
@@ -253,7 +253,7 @@ void DataDeviceManager::comp_accept(wl_client *, wl_resource *, uint32_t, const
void DataDeviceManager::comp_receive(wl_client *client, wl_resource *resource, const char *mime_type, int32_t fd)
{
Q_UNUSED(client);
- DataDeviceManager *self = static_cast<DataDeviceManager *>(resource->data);
+ DataDeviceManager *self = static_cast<DataDeviceManager *>(wl_resource_get_user_data(resource));
//qDebug("client %p wants data for type %s from compositor", client, mime_type);
QByteArray content = QWaylandMimeHelper::getByteArray(&self->m_retainedData, QString::fromLatin1(mime_type));
if (!content.isEmpty()) {
diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h
index 00e1d239f..0a05a6733 100644
--- a/src/compositor/wayland_wrapper/qwlregion_p.h
+++ b/src/compositor/wayland_wrapper/qwlregion_p.h
@@ -70,7 +70,7 @@ public:
static Region *fromResource(struct ::wl_resource *resource);
- uint id() const { return resource()->handle->object.id; }
+ uint id() const { return wl_resource_get_id(resource()->handle); }
QRegion region() const { return m_region; }