Sync up with the latest wayland developments.
authorHannu Lyytinen <hannu.lyytinen@nomovok.com>
Wed, 18 Apr 2012 20:14:47 +0000 (23:14 +0300)
committerSamuel Rødal <samuel.rodal@nokia.com>
Thu, 19 Apr 2012 07:10:18 +0000 (09:10 +0200)
This commit makes the qtwayland module compatible with
wayland sha1 677c5180e67be18b7a0867fafb7f205b57a6e9ff.

Change-Id: I5af0510034b7e4a038313b80f1f6e0b18fa48eb3
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
21 files changed:
src/compositor/global/waylandresourcecollection.cpp
src/compositor/global/waylandresourcecollection.h
src/compositor/wayland_wrapper/wldatasource.cpp
src/compositor/wayland_wrapper/wlinputdevice.cpp
src/compositor/wayland_wrapper/wlregion.cpp
src/compositor/wayland_wrapper/wlshellsurface.cpp
src/compositor/wayland_wrapper/wlshellsurface.h
src/compositor/wayland_wrapper/wlsurface.cpp
src/compositor/wayland_wrapper/wlsurfacebuffer.cpp
src/compositor/wayland_wrapper/wlsurfacebuffer.h
src/plugins/platforms/wayland/qwaylandinputdevice.cpp
src/plugins/platforms/wayland/qwaylandinputdevice.h
src/plugins/platforms/wayland/qwaylandshellsurface.cpp
src/plugins/platforms/wayland/qwaylandshellsurface.h
src/plugins/platforms/wayland/qwaylandwindow.cpp
src/plugins/platforms/wayland/qwaylandwindow.h
tests/auto/client/mockcompositor.cpp
tests/auto/client/mockcompositor.h
tests/auto/client/mockinput.cpp
tests/auto/client/mocksurface.cpp
wayland_sha1.txt

index 2bbf8db..c696182 100644 (file)
@@ -58,8 +58,8 @@ void ResourceCollection::registerResource(struct wl_resource *resource)
 {
     wl_list_insert(&client_resources,&resource->link);
     struct wl_listener *listener = new struct wl_listener;
-    listener->func = ResourceCollection::destroy_listener_func;
-    wl_list_insert(&resource->destroy_listener_list,&listener->link);
+    listener->notify = ResourceCollection::destroy_listener_notify;
+    wl_signal_add(&resource->destroy_signal, listener);
 }
 
 struct wl_resource *ResourceCollection::resourceForClient(wl_client *client) const
@@ -79,11 +79,9 @@ bool ResourceCollection::resourceListIsEmpty() const
     return wl_list_empty(const_cast<struct wl_list *>(&client_resources));
 }
 
-void ResourceCollection::destroy_listener_func(struct wl_listener *listener,
-                                   wl_resource *resource,
-                                   uint32_t time)
+void ResourceCollection::destroy_listener_notify(struct wl_listener *listener, void *data)
 {
-    Q_UNUSED(time);
+    struct wl_resource *resource = reinterpret_cast<struct wl_resource *>(data);
     wl_list_remove(&resource->link);
     delete listener;
 }
index cc2311f..9fff65f 100644 (file)
@@ -57,9 +57,7 @@ public:
 protected:
     struct wl_list client_resources;
 private:
-    static void destroy_listener_func(struct wl_listener *listener,
-             struct wl_resource *resource, uint32_t time);
-
+    static void destroy_listener_notify(struct wl_listener *listener, void *data);
 };
 
 }
index 7c9f2cc..8b908d2 100644 (file)
@@ -63,7 +63,7 @@ DataSource::~DataSource()
     qDebug() << "destroying source";
     if (m_manager)
         m_manager->sourceDestroyed(this);
-    wl_resource_destroy(m_data_source_resource,Compositor::currentTimeMsecs());
+    wl_resource_destroy(m_data_source_resource);
 }
 
 void DataSource::resource_destroy(wl_resource *resource)
index af9c607..5f3d862 100644 (file)
@@ -108,8 +108,9 @@ void InputDevice::sendKeyPressEvent(uint code)
 {
     if (base()->keyboard_focus_resource != NULL) {
         uint32_t time = m_compositor->currentTimeMsecs();
+        uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
         wl_input_device_send_key(base()->keyboard_focus_resource,
-                                 time, code - 8, 1);
+                                 serial, time, code - 8, 1);
     }
 }
 
@@ -117,26 +118,28 @@ void InputDevice::sendKeyReleaseEvent(uint code)
 {
     if (base()->keyboard_focus_resource != NULL) {
         uint32_t time = m_compositor->currentTimeMsecs();
+        uint32_t serial = wl_display_next_serial(m_compositor->wl_display());
         wl_input_device_send_key(base()->keyboard_focus_resource,
-                                 time, code - 8, 0);
+                                 serial, time, code - 8, 0);
     }
 }
 
 void InputDevice::sendTouchPointEvent(int id, int x, int y, Qt::TouchPointState state)
 {
     uint32_t time = m_compositor->currentTimeMsecs();
+    uint32_t serial = 0;
     struct wl_resource *resource = base()->pointer_focus_resource;
     if (!resource)
         return;
     switch (state) {
     case Qt::TouchPointPressed:
-        wl_input_device_send_touch_down(resource, time, &base()->pointer_focus->resource, id, x, y);
+        wl_input_device_send_touch_down(resource, serial, time, &base()->pointer_focus->resource, id, x, y);
         break;
     case Qt::TouchPointMoved:
         wl_input_device_send_touch_motion(resource, time, id, x, y);
         break;
     case Qt::TouchPointReleased:
-        wl_input_device_send_touch_up(resource, time, id);
+        wl_input_device_send_touch_up(resource, serial, time, id);
         break;
     case Qt::TouchPointStationary:
         // stationary points are not sent through wayland, the client must cache them
@@ -218,7 +221,7 @@ Surface *InputDevice::keyboardFocus() const
 void InputDevice::setKeyboardFocus(Surface *surface)
 {
     sendSelectionFocus(surface);
-    wl_input_device_set_keyboard_focus(base(), surface ? surface->base() : 0, m_compositor->currentTimeMsecs());
+    wl_input_device_set_keyboard_focus(base(), surface ? surface->base() : 0);
 }
 
 Surface *InputDevice::mouseFocus() const
@@ -234,7 +237,6 @@ void InputDevice::setMouseFocus(Surface *surface, const QPoint &globalPos, const
     base()->current_x = localPos.x();
     base()->current_y = localPos.y();
     base()->pointer_grab->interface->focus(base()->pointer_grab,
-                        m_compositor->currentTimeMsecs(),
                         surface ? surface->base() : 0,
                         localPos.x(), localPos.y());
 }
index 7553da7..bb6d382 100644 (file)
@@ -68,7 +68,7 @@ const struct wl_region_interface Region::region_interface = {
 void Region::region_destroy(wl_client *client, wl_resource *region)
 {
     Q_UNUSED(client);
-    wl_resource_destroy(region, Compositor::currentTimeMsecs());
+    wl_resource_destroy(region);
 }
 
 void Region::region_add(wl_client *client, wl_resource *region,
index 4751250..7f0a3ee 100644 (file)
@@ -166,7 +166,7 @@ void ShellSurface::move(struct wl_client *client,
     self->m_moveGrabber->offset_x = input_device->base()->x - self->surface()->pos().x();
     self->m_moveGrabber->offset_y = input_device->base()->y - self->surface()->pos().y();
 
-    wl_input_device_start_pointer_grab(input_device->base(),self->m_moveGrabber->base(),Compositor::currentTimeMsecs());
+    wl_input_device_start_pointer_grab(input_device->base(),self->m_moveGrabber->base());
 }
 
 void ShellSurface::resize(struct wl_client *client,
@@ -192,7 +192,7 @@ void ShellSurface::resize(struct wl_client *client,
     self->m_resizeGrabber->width = self->surface()->size().width();
     self->m_resizeGrabber->height = self->surface()->size().height();
 
-    wl_input_device_start_pointer_grab(input_device->base(),self->m_resizeGrabber->base(),Compositor::currentTimeMsecs());
+    wl_input_device_start_pointer_grab(input_device->base(),self->m_resizeGrabber->base());
 }
 
 void ShellSurface::set_toplevel(struct wl_client *client,
@@ -314,7 +314,7 @@ ShellSurfaceResizeGrabber::ShellSurfaceResizeGrabber(ShellSurface *shellSurface)
 {
 }
 
-void ShellSurfaceResizeGrabber::focus(wl_pointer_grab *grab, uint32_t time, wl_surface *surface, int32_t x, int32_t y)
+void ShellSurfaceResizeGrabber::focus(wl_pointer_grab *grab, wl_surface *surface, int32_t x, int32_t y)
 {
 }
 
@@ -369,7 +369,7 @@ void ShellSurfaceResizeGrabber::button(wl_pointer_grab *grab, uint32_t time, uin
     ShellSurfaceResizeGrabber *self = reinterpret_cast<ShellSurfaceResizeGrabber *>(grab);
     ShellSurface *shell_surface = self->shell_surface;
     if (toQtButton(button) == Qt::LeftButton && !state) {
-        wl_input_device_end_pointer_grab(grab->input_device,Compositor::currentTimeMsecs());
+        wl_input_device_end_pointer_grab(grab->input_device);
         shell_surface->resetResizeGrabber();
         delete self;
     }
@@ -386,7 +386,7 @@ ShellSurfaceMoveGrabber::ShellSurfaceMoveGrabber(ShellSurface *shellSurface)
 {
 }
 
-void ShellSurfaceMoveGrabber::focus(wl_pointer_grab *grab, uint32_t time, wl_surface *surface, int32_t x, int32_t y)
+void ShellSurfaceMoveGrabber::focus(wl_pointer_grab *grab, wl_surface *surface, int32_t x, int32_t y)
 {
 }
 
@@ -409,8 +409,8 @@ void ShellSurfaceMoveGrabber::button(wl_pointer_grab *grab, uint32_t time, uint3
     ShellSurfaceResizeGrabber *self = reinterpret_cast<ShellSurfaceResizeGrabber *>(grab);
     ShellSurface *shell_surface = self->shell_surface;
     if (toQtButton(button) == Qt::LeftButton && !state) {
-        wl_input_device_set_pointer_focus(grab->input_device,0,Compositor::currentTimeMsecs(),0,0);
-        wl_input_device_end_pointer_grab(grab->input_device,Compositor::currentTimeMsecs());
+        wl_input_device_set_pointer_focus(grab->input_device,0,0,0);
+        wl_input_device_end_pointer_grab(grab->input_device);
         shell_surface->resetMoveGrabber();
         delete self;
     }
index 1cdb6f4..3f8d42a 100644 (file)
@@ -158,7 +158,7 @@ public:
     int32_t width;
     int32_t height;
 
-    static void focus(struct wl_pointer_grab *grab, uint32_t time,
+    static void focus(struct wl_pointer_grab *grab,
                       struct wl_surface *surface, int32_t x, int32_t y);
     static void motion(struct wl_pointer_grab *grab,
                        uint32_t time, int32_t x, int32_t y);
@@ -175,7 +175,7 @@ public:
     int32_t offset_x;
     int32_t offset_y;
 
-    static void focus(struct wl_pointer_grab *grab, uint32_t time,
+    static void focus(struct wl_pointer_grab *grab,
                       struct wl_surface *surface, int32_t x, int32_t y);
     static void motion(struct wl_pointer_grab *grab,
                        uint32_t time, int32_t x, int32_t y);
index 091f059..4f8c6f9 100644 (file)
@@ -236,7 +236,7 @@ void Surface::sendFrameCallback()
     struct wl_resource *frame_callback;
     wl_list_for_each(frame_callback, &m_frame_callback_list, link) {
         wl_callback_send_done(frame_callback, time);
-        wl_resource_destroy(frame_callback,Compositor::currentTimeMsecs());
+        wl_resource_destroy(frame_callback);
     }
     wl_list_init(&m_frame_callback_list);
 
@@ -429,7 +429,7 @@ const struct wl_surface_interface Surface::surface_interface = {
 
 void Surface::surface_destroy(struct wl_client *, struct wl_resource *surface_resource)
 {
-    wl_resource_destroy(surface_resource,Compositor::currentTimeMsecs());
+    wl_resource_destroy(surface_resource);
 }
 
 void Surface::surface_attach(struct wl_client *client, struct wl_resource *surface,
index f6d7754..ad8d3d6 100644 (file)
@@ -81,9 +81,9 @@ void SurfaceBuffer::initialize(wl_buffer *buffer)
     m_is_displayed = false;
     m_destroyed = false;
     m_destroy_listener.surfaceBuffer = this;
-    m_destroy_listener.listener.func = destroy_listener_callback;
+    m_destroy_listener.listener.notify = destroy_listener_callback;
     if (buffer)
-        wl_list_insert(&buffer->resource.destroy_listener_list,&m_destroy_listener.listener.link);
+        wl_signal_add(&buffer->resource.destroy_signal, &m_destroy_listener.listener);
     m_damageRect = QRect();
 }
 
@@ -183,10 +183,9 @@ void *SurfaceBuffer::handle() const
     return m_handle;
 }
 
-void SurfaceBuffer::destroy_listener_callback(wl_listener *listener, wl_resource *resource, uint32_t time)
+void SurfaceBuffer::destroy_listener_callback(wl_listener *listener, void *data)
 {
-        Q_UNUSED(resource);
-        Q_UNUSED(time);
+        Q_UNUSED(data);
         struct surface_buffer_destroy_listener *destroy_listener =
                 reinterpret_cast<struct surface_buffer_destroy_listener *>(listener);
         SurfaceBuffer *d = destroy_listener->surfaceBuffer;
index c4d7209..44e32e6 100644 (file)
@@ -122,9 +122,7 @@ private:
 #endif
     void *m_handle;
 
-    static void destroy_listener_callback(struct wl_listener *listener,
-             struct wl_resource *resource, uint32_t time);
-
+    static void destroy_listener_callback(wl_listener *listener, void *data);
 };
 
 GLuint SurfaceBuffer::texture() const
index 7ac47f9..88cde46 100644 (file)
@@ -165,9 +165,11 @@ void QWaylandInputDevice::inputHandleMotion(void *data,
 
 void QWaylandInputDevice::inputHandleButton(void *data,
                                            struct wl_input_device *input_device,
-                                           uint32_t time, uint32_t button, uint32_t state)
+                                            uint32_t serial, uint32_t time,
+                                            uint32_t button, uint32_t state)
 {
     Q_UNUSED(input_device);
+    Q_UNUSED(serial);
     QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
     QWaylandWindow *window = inputDevice->mPointerFocus;
     Qt::MouseButton qt_button;
@@ -295,9 +297,11 @@ static uint32_t translateKey(uint32_t sym, char *string, size_t size)
 
 void QWaylandInputDevice::inputHandleKey(void *data,
                                         struct wl_input_device *input_device,
-                                        uint32_t time, uint32_t key, uint32_t state)
+                                         uint32_t serial, uint32_t time,
+                                         uint32_t key, uint32_t state)
 {
     Q_UNUSED(input_device);
+    Q_UNUSED(serial);
     QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
     QWaylandWindow *window = inputDevice->mKeyboardFocus;
 #ifndef QT_NO_WAYLAND_XKB
@@ -446,6 +450,7 @@ void QWaylandInputDevice::inputHandleKeyboardLeave(void *data,
 
 void QWaylandInputDevice::inputHandleTouchDown(void *data,
                                                struct wl_input_device *wl_input_device,
+                                               uint32_t serial,
                                                uint32_t time,
                                                struct wl_surface *surface,
                                                int id,
@@ -453,6 +458,7 @@ void QWaylandInputDevice::inputHandleTouchDown(void *data,
                                                int y)
 {
     Q_UNUSED(wl_input_device);
+    Q_UNUSED(serial);
     Q_UNUSED(time);
     QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
     inputDevice->mTouchFocus = static_cast<QWaylandWindow *>(wl_surface_get_user_data(surface));
@@ -461,10 +467,12 @@ void QWaylandInputDevice::inputHandleTouchDown(void *data,
 
 void QWaylandInputDevice::inputHandleTouchUp(void *data,
                                              struct wl_input_device *wl_input_device,
+                                             uint32_t serial,
                                              uint32_t time,
                                              int id)
 {
     Q_UNUSED(wl_input_device);
+    Q_UNUSED(serial);
     Q_UNUSED(time);
     QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
     inputDevice->mTouchFocus = 0;
index 7c80c1f..e6528f3 100644 (file)
@@ -92,7 +92,8 @@ private:
                                  int32_t sx, int32_t sy);
     static void inputHandleButton(void *data,
                                  struct wl_input_device *input_device,
-                                 uint32_t time, uint32_t button, uint32_t state);
+                                  uint32_t serial, uint32_t time,
+                                  uint32_t button, uint32_t state);
     static void inputHandleAxis(void *data,
                                 struct wl_input_device *wl_input_device,
                                 uint32_t time,
@@ -100,7 +101,8 @@ private:
                                 int32_t value);
     static void inputHandleKey(void *data,
                               struct wl_input_device *input_device,
-                              uint32_t time, uint32_t key, uint32_t state);
+                               uint32_t serial, uint32_t time,
+                               uint32_t key, uint32_t state);
     static void inputHandlePointerEnter(void *data,
                                         struct wl_input_device *input_device,
                                         uint32_t time, struct wl_surface *surface,
@@ -119,6 +121,7 @@ private:
                                          struct wl_surface *surface);
     static void inputHandleTouchDown(void *data,
                                      struct wl_input_device *wl_input_device,
+                                     uint32_t serial,
                                      uint32_t time,
                                      struct wl_surface *surface,
                                      int id,
@@ -126,6 +129,7 @@ private:
                                      int y);
     static void inputHandleTouchUp(void *data,
                                    struct wl_input_device *wl_input_device,
+                                   uint32_t serial,
                                    uint32_t time,
                                    int id);
     static void inputHandleTouchMotion(void *data,
index 69848f2..96c3fb2 100644 (file)
@@ -90,14 +90,13 @@ void QWaylandShellSurface::updateTransientParent(QWindow *parent)
 
 void QWaylandShellSurface::configure(void *data,
                                      wl_shell_surface *wl_shell_surface,
-                                     uint32_t time,
                                      uint32_t edges,
                                      int32_t width,
                                      int32_t height)
 {
     Q_UNUSED(wl_shell_surface);
     QWaylandShellSurface *shell_surface = static_cast<QWaylandShellSurface *>(data);
-    shell_surface->m_window->configure(time,edges,width,height);
+    shell_surface->m_window->configure(edges, width, height);
 }
 
 void QWaylandShellSurface::popup_done(void *data,
index e7e46ab..148bb0e 100644 (file)
@@ -69,7 +69,6 @@ private:
 
     static void configure(void *data,
               struct wl_shell_surface *wl_shell_surface,
-              uint32_t time,
               uint32_t edges,
               int32_t width,
               int32_t height);
index 9f0d31c..afd6489 100644 (file)
@@ -176,10 +176,8 @@ bool QWaylandWindow::isExposed() const
 }
 
 
-void QWaylandWindow::configure(uint32_t time, uint32_t edges,
-                               int32_t width, int32_t height)
+void QWaylandWindow::configure(uint32_t edges, int32_t width, int32_t height)
 {
-    Q_UNUSED(time);
     Q_UNUSED(edges);
 
     int widthWithoutMargins = qMax(width-(frameMargins().left() +frameMargins().right()),1);
index a07368b..3f472e9 100644 (file)
@@ -76,8 +76,7 @@ public:
 
     void setGeometry(const QRect &rect);
 
-    void configure(uint32_t time, uint32_t edges,
-                   int32_t width, int32_t height);
+    void configure(uint32_t edges, int32_t width, int32_t height);
 
     void attach(QWaylandBuffer *buffer);
     QWaylandBuffer *attached() const;
index 119adc0..6c7c66f 100644 (file)
@@ -244,11 +244,9 @@ void Compositor::bindCompositor(wl_client *client, void *compositorData, uint32_
     wl_client_add_object(client, &wl_compositor_interface, &compositorInterface, id, compositorData);
 }
 
-static void unregisterResourceCallback(wl_listener *listener,
-                                wl_resource *resource,
-                                uint32_t time)
+static void unregisterResourceCallback(wl_listener *listener, void *data)
 {
-    Q_UNUSED(time);
+    struct wl_resource *resource = reinterpret_cast<struct wl_resource *>(data);
     wl_list_remove(&resource->link);
     delete listener;
 }
@@ -258,9 +256,9 @@ void registerResource(wl_list *list, wl_resource *resource)
     wl_list_insert(list, &resource->link);
 
     wl_listener *listener = new wl_listener;
-    listener->func = unregisterResourceCallback;
+    listener->notify = unregisterResourceCallback;
 
-    wl_list_insert(&resource->destroy_listener_list, &listener->link);
+    wl_signal_add(&resource->destroy_signal, listener);
 }
 
 QVector<Surface *> Compositor::surfaces() const
@@ -268,6 +266,11 @@ QVector<Surface *> Compositor::surfaces() const
     return m_surfaces;
 }
 
+uint32_t Compositor::nextSerial()
+{
+    return wl_display_next_serial(m_display);
+}
+
 void Compositor::addSurface(Surface *surface)
 {
     m_surfaces << surface;
index 2d1e418..c47f5f2 100644 (file)
@@ -69,6 +69,7 @@ public:
     int fileDescriptor() const { return m_fd; }
     void dispatchEvents(int timeout = 0);
 
+    uint32_t nextSerial();
     uint32_t time() { return ++m_time; }
 
     static void setOutputGeometry(void *compositor, const QList<QVariant> &parameters);
index b5c90d7..4138e8f 100644 (file)
@@ -95,7 +95,7 @@ static wl_surface *resolveSurface(const QVariant &v)
 void Compositor::setKeyboardFocus(void *data, const QList<QVariant> &parameters)
 {
     Compositor *compositor = static_cast<Compositor *>(data);
-    wl_input_device_set_keyboard_focus(&compositor->m_input, resolveSurface(parameters.first()), compositor->time());
+    wl_input_device_set_keyboard_focus(&compositor->m_input, resolveSurface(parameters.first()));
 }
 
 void Compositor::sendMousePress(void *data, const QList<QVariant> &parameters)
@@ -106,9 +106,10 @@ void Compositor::sendMousePress(void *data, const QList<QVariant> &parameters)
         return;
 
     QPoint pos = parameters.last().toPoint();
-    wl_input_device_set_pointer_focus(&compositor->m_input, surface, compositor->time(), pos.x(), pos.y());
+    wl_input_device_set_pointer_focus(&compositor->m_input, surface, pos.x(), pos.y());
     wl_input_device_send_motion(compositor->m_input.pointer_focus_resource, compositor->time(), pos.x(), pos.y());
-    wl_input_device_send_button(compositor->m_input.pointer_focus_resource, compositor->time(), 0x110, 1);
+    wl_input_device_send_button(compositor->m_input.pointer_focus_resource,
+        compositor->nextSerial(), compositor->time(), 0x110, 1);
 }
 
 void Compositor::sendMouseRelease(void *data, const QList<QVariant> &parameters)
@@ -118,7 +119,8 @@ void Compositor::sendMouseRelease(void *data, const QList<QVariant> &parameters)
     if (!surface)
         return;
 
-    wl_input_device_send_button(compositor->m_input.pointer_focus_resource, compositor->time(), 0x110, 0);
+    wl_input_device_send_button(compositor->m_input.pointer_focus_resource,
+        compositor->nextSerial(), compositor->time(), 0x110, 0);
 }
 
 void Compositor::sendKeyPress(void *data, const QList<QVariant> &parameters)
@@ -129,7 +131,8 @@ void Compositor::sendKeyPress(void *data, const QList<QVariant> &parameters)
         return;
 
     QPoint pos = parameters.last().toPoint();
-    wl_input_device_send_key(compositor->m_input.keyboard_focus_resource, compositor->time(), parameters.last().toUInt() - 8, 1);
+    wl_input_device_send_key(compositor->m_input.keyboard_focus_resource,
+        compositor->nextSerial(), compositor->time(), parameters.last().toUInt() - 8, 1);
 }
 
 void Compositor::sendKeyRelease(void *data, const QList<QVariant> &parameters)
@@ -139,7 +142,8 @@ void Compositor::sendKeyRelease(void *data, const QList<QVariant> &parameters)
     if (!surface)
         return;
 
-    wl_input_device_send_key(compositor->m_input.keyboard_focus_resource, compositor->time(), parameters.last().toUInt() - 8, 0);
+    wl_input_device_send_key(compositor->m_input.keyboard_focus_resource,
+        compositor->nextSerial(), compositor->time(), parameters.last().toUInt() - 8, 0);
 }
 
 }
index f149822..43d63af 100644 (file)
@@ -53,8 +53,7 @@ void destroy_surface(wl_resource *resource)
 
 static void surface_destroy(wl_client *, wl_resource *surfaceResource)
 {
-    Surface *surface = static_cast<Surface *>(surfaceResource->data);
-    wl_resource_destroy(surfaceResource, surface->compositor()->time());
+    wl_resource_destroy(surfaceResource);
 }
 
 void surface_attach(wl_client *client, wl_resource *surfaceResource,
@@ -99,7 +98,7 @@ void surface_damage(wl_client *client, wl_resource *surfaceResource,
     wl_resource *frameCallback;
     wl_list_for_each(frameCallback, &surface->m_frameCallbackList, link) {
         wl_callback_send_done(frameCallback, surface->m_compositor->time());
-        wl_resource_destroy(frameCallback, surface->m_compositor->time());
+        wl_resource_destroy(frameCallback);
     }
 
     wl_list_init(&surface->m_frameCallbackList);
index 5a39d51..345ea77 100644 (file)
@@ -1,3 +1,3 @@
 This version of Qt-Compositor is checked against the following sha1 from the
 Wayland repository:
-a13aab4e15f7defe8207dfc18277321166577d7a
+677c5180e67be18b7a0867fafb7f205b57a6e9ff