From 9b3c557460a344ef6d1d171f0bd5fd7ba5020314 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Sat, 22 Sep 2012 01:13:02 +0200 Subject: [PATCH] Prevent crashing the compositor when the client wants to unset the cursor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I40460110e24555aacaef928af32372c32a3291d1 Reviewed-by: Jørgen Lind --- src/compositor/wayland_wrapper/wlinputdevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp index c3e977e..41cbc38 100644 --- a/src/compositor/wayland_wrapper/wlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/wlinputdevice.cpp @@ -518,7 +518,7 @@ void InputDevice::pointer_attach(struct wl_client *client, InputDevice *inputDevice = wayland_cast(pointer->seat); wl_buffer *buffer = reinterpret_cast(buffer_resource); - if (wl_buffer_is_shm(buffer)) { + if (buffer && wl_buffer_is_shm(buffer)) { int stride = wl_shm_buffer_get_stride(buffer); uint format = wl_shm_buffer_get_format(buffer); (void) format; @@ -530,6 +530,8 @@ void InputDevice::pointer_attach(struct wl_client *client, delete currentCursor; currentCursor = img; } + } else { + inputDevice->m_compositor->waylandCompositor()->changeCursor(QImage(), x, y); } } -- 2.7.4