diff options
author | Hannu Lyytinen <hannu.lyytinen@nomovok.com> | 2012-04-18 23:14:47 +0300 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2012-04-19 09:10:18 +0200 |
commit | f3fde00e041b5a974f49f994ea96b8db729f96cc (patch) | |
tree | 8248007ab3f1c5ff5d206ffa232541d826859d41 | |
parent | f83a56dcb4b0a81a51e56bb516cb98de75fc6ae5 (diff) |
Sync up with the latest wayland developments.
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, 73 insertions, 64 deletions
diff --git a/src/compositor/global/waylandresourcecollection.cpp b/src/compositor/global/waylandresourcecollection.cpp index 2bbf8dbae..c69618204 100644 --- a/src/compositor/global/waylandresourcecollection.cpp +++ b/src/compositor/global/waylandresourcecollection.cpp @@ -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; } diff --git a/src/compositor/global/waylandresourcecollection.h b/src/compositor/global/waylandresourcecollection.h index cc2311fea..9fff65f04 100644 --- a/src/compositor/global/waylandresourcecollection.h +++ b/src/compositor/global/waylandresourcecollection.h @@ -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); }; } diff --git a/src/compositor/wayland_wrapper/wldatasource.cpp b/src/compositor/wayland_wrapper/wldatasource.cpp index 7c9f2cc35..8b908d286 100644 --- a/src/compositor/wayland_wrapper/wldatasource.cpp +++ b/src/compositor/wayland_wrapper/wldatasource.cpp @@ -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) diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp index af9c60766..5f3d8622b 100644 --- a/src/compositor/wayland_wrapper/wlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/wlinputdevice.cpp @@ -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()); } diff --git a/src/compositor/wayland_wrapper/wlregion.cpp b/src/compositor/wayland_wrapper/wlregion.cpp index 7553da7af..bb6d38261 100644 --- a/src/compositor/wayland_wrapper/wlregion.cpp +++ b/src/compositor/wayland_wrapper/wlregion.cpp @@ -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, diff --git a/src/compositor/wayland_wrapper/wlshellsurface.cpp b/src/compositor/wayland_wrapper/wlshellsurface.cpp index 4751250a0..7f0a3ee35 100644 --- a/src/compositor/wayland_wrapper/wlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/wlshellsurface.cpp @@ -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; } diff --git a/src/compositor/wayland_wrapper/wlshellsurface.h b/src/compositor/wayland_wrapper/wlshellsurface.h index 1cdb6f42d..3f8d42a8f 100644 --- a/src/compositor/wayland_wrapper/wlshellsurface.h +++ b/src/compositor/wayland_wrapper/wlshellsurface.h @@ -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); diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp index 091f059ff..4f8c6f913 100644 --- a/src/compositor/wayland_wrapper/wlsurface.cpp +++ b/src/compositor/wayland_wrapper/wlsurface.cpp @@ -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, diff --git a/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp index f6d77545d..ad8d3d659 100644 --- a/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp @@ -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; diff --git a/src/compositor/wayland_wrapper/wlsurfacebuffer.h b/src/compositor/wayland_wrapper/wlsurfacebuffer.h index c4d7209d6..44e32e628 100644 --- a/src/compositor/wayland_wrapper/wlsurfacebuffer.h +++ b/src/compositor/wayland_wrapper/wlsurfacebuffer.h @@ -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 diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 7ac47f9a9..88cde461e 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -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; diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.h b/src/plugins/platforms/wayland/qwaylandinputdevice.h index 7c80c1fca..e6528f399 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.h +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.h @@ -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, diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp index 69848f282..96c3fb24b 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp @@ -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, diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.h b/src/plugins/platforms/wayland/qwaylandshellsurface.h index e7e46ab6d..148bb0e18 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.h +++ b/src/plugins/platforms/wayland/qwaylandshellsurface.h @@ -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); diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 9f0d31c6f..afd648918 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -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); diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index a07368b70..3f472e9db 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -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; diff --git a/tests/auto/client/mockcompositor.cpp b/tests/auto/client/mockcompositor.cpp index 119adc054..6c7c66fa7 100644 --- a/tests/auto/client/mockcompositor.cpp +++ b/tests/auto/client/mockcompositor.cpp @@ -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; diff --git a/tests/auto/client/mockcompositor.h b/tests/auto/client/mockcompositor.h index 2d1e41836..c47f5f2d1 100644 --- a/tests/auto/client/mockcompositor.h +++ b/tests/auto/client/mockcompositor.h @@ -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> ¶meters); diff --git a/tests/auto/client/mockinput.cpp b/tests/auto/client/mockinput.cpp index b5c90d7ed..4138e8f38 100644 --- a/tests/auto/client/mockinput.cpp +++ b/tests/auto/client/mockinput.cpp @@ -95,7 +95,7 @@ static wl_surface *resolveSurface(const QVariant &v) void Compositor::setKeyboardFocus(void *data, const QList<QVariant> ¶meters) { 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> ¶meters) @@ -106,9 +106,10 @@ void Compositor::sendMousePress(void *data, const QList<QVariant> ¶meters) 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> ¶meters) @@ -118,7 +119,8 @@ void Compositor::sendMouseRelease(void *data, const QList<QVariant> ¶meters) 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> ¶meters) @@ -129,7 +131,8 @@ void Compositor::sendKeyPress(void *data, const QList<QVariant> ¶meters) 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> ¶meters) @@ -139,7 +142,8 @@ void Compositor::sendKeyRelease(void *data, const QList<QVariant> ¶meters) 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); } } diff --git a/tests/auto/client/mocksurface.cpp b/tests/auto/client/mocksurface.cpp index f149822f6..43d63af6d 100644 --- a/tests/auto/client/mocksurface.cpp +++ b/tests/auto/client/mocksurface.cpp @@ -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); diff --git a/wayland_sha1.txt b/wayland_sha1.txt index 5a39d5136..345ea779a 100644 --- a/wayland_sha1.txt +++ b/wayland_sha1.txt @@ -1,3 +1,3 @@ This version of Qt-Compositor is checked against the following sha1 from the Wayland repository: -a13aab4e15f7defe8207dfc18277321166577d7a +677c5180e67be18b7a0867fafb7f205b57a6e9ff |