summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/wlcompositor.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2012-01-10 08:06:45 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2012-01-10 15:55:40 +0100
commitbdabd7cc79709c8fb9c2c0187c5d6ac11ae85c5b (patch)
tree009875381a6f958f8e27f1c3d55a63e45f53d528 /src/compositor/wayland_wrapper/wlcompositor.cpp
parente35d1a00541f3f2a1ed692a910b86f9344d12085 (diff)
Cleanup Wayland::Surface's client handle logic
This is code which is either fairly old or where the api has changed. Anyway, Surfaces allways have a client handle in the resource, so no need to check it or store it. Change-Id: If0be4bed177d42f168b5384a820b8e681e6d9539 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlcompositor.cpp')
-rw-r--r--src/compositor/wayland_wrapper/wlcompositor.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/wlcompositor.cpp
index d777921a2..9d9538755 100644
--- a/src/compositor/wayland_wrapper/wlcompositor.cpp
+++ b/src/compositor/wayland_wrapper/wlcompositor.cpp
@@ -77,12 +77,6 @@ namespace Wayland {
static Compositor *compositor;
-void destroy_surface(struct wl_resource *resource)
-{
- Surface *surface = wayland_cast<Surface *>((wl_surface *)resource);
- delete surface;
-}
-
void compositor_create_surface(struct wl_client *client,
struct wl_resource *resource, uint32_t id)
{
@@ -181,14 +175,11 @@ void Compositor::frameFinished(Surface *surface)
}
}
-void Compositor::createSurface(struct wl_client *client, int id)
+void Compositor::createSurface(struct wl_client *client, uint32_t id)
{
- Surface *surface = new Surface(client, this);
+ Surface *surface = new Surface(client,id, this);
printf("Compositor::createSurface: %p %d\n", client, id);
- addClientResource(client, &surface->base()->resource, id, &wl_surface_interface,
- &Surface::surface_interface, destroy_surface);
-
QList<struct wl_client *> prevClientList = clients();
m_surfaces << surface;
@@ -396,7 +387,7 @@ QList<Wayland::Surface *> Compositor::surfacesForClient(wl_client *client)
QList<Wayland::Surface *> ret;
for (int i=0; i < m_surfaces.count(); ++i) {
- if (m_surfaces.at(i)->clientHandle() == client) {
+ if (m_surfaces.at(i)->base()->resource.client == client) {
ret.append(m_surfaces.at(i));
}
}