diff --git a/egl_wayland_backend.cpp b/egl_wayland_backend.cpp index 67ed4fe2c3..12378d133d 100644 --- a/egl_wayland_backend.cpp +++ b/egl_wayland_backend.cpp @@ -81,8 +81,8 @@ static void registryHandleGlobalRemove(void *data, struct wl_registry *registry, **/ static void handlePing(void *data, struct wl_shell_surface *shellSurface, uint32_t serial) { - Q_UNUSED(data) - wl_shell_surface_pong(shellSurface, serial); + Q_UNUSED(shellSurface); + reinterpret_cast(data)->ping(serial); } /** @@ -383,6 +383,14 @@ void X11CursorTracker::setEnteredSerial(uint32_t serial) m_enteredSerial = serial; } +void X11CursorTracker::resetCursor() +{ + QHash::iterator it = m_cursors.find(m_lastX11Cursor); + if (it != m_cursors.end()) { + installCursor(it.value()); + } +} + ShmPool::ShmPool(wl_shm *shm) : m_shm(shm) , m_pool(NULL) @@ -505,6 +513,13 @@ void WaylandSeat::pointerEntered(uint32_t serial) m_cursorTracker->setEnteredSerial(serial); } +void WaylandSeat::resetCursor() +{ + if (!m_cursorTracker.isNull()) { + m_cursorTracker->resetCursor(); + } +} + WaylandBackend::WaylandBackend() : m_display(wl_display_connect(NULL)) , m_registry(wl_display_get_registry(m_display)) @@ -591,6 +606,14 @@ void WaylandBackend::createShm(uint32_t name) } } +void WaylandBackend::ping(uint32_t serial) +{ + wl_shell_surface_pong(m_shellSurface, serial); + if (!m_seat.isNull()) { + m_seat->resetCursor(); + } +} + } EglWaylandBackend::EglWaylandBackend() diff --git a/egl_wayland_backend.h b/egl_wayland_backend.h index 451fe4531c..afdf8c43ad 100644 --- a/egl_wayland_backend.h +++ b/egl_wayland_backend.h @@ -62,6 +62,7 @@ public: explicit X11CursorTracker(wl_pointer *pointer, WaylandBackend *backend, QObject* parent = 0); virtual ~X11CursorTracker(); void setEnteredSerial(uint32_t serial); + void resetCursor(); private Q_SLOTS: void cursorChanged(uint32_t serial); private: @@ -102,6 +103,7 @@ public: void changed(uint32_t capabilities); wl_seat *seat(); void pointerEntered(uint32_t serial); + void resetCursor(); private: void destroyPointer(); void destroyKeyboard(); @@ -133,6 +135,7 @@ public: ShmPool *shmPool(); void createSeat(uint32_t name); void createShm(uint32_t name); + void ping(uint32_t serial); bool createSurface(); private: