summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/wlinputdevice.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-09-22 01:13:02 +0200
committerJørgen Lind <jorgen.lind@gmail.com>2012-09-22 10:44:42 +0200
commit9b3c557460a344ef6d1d171f0bd5fd7ba5020314 (patch)
tree84cc91ff33b301d2a38d63a2daa5512c980f3ac6 /src/compositor/wayland_wrapper/wlinputdevice.cpp
parentbeadb6ff6072c99948940ebbd2d7db42d06bb3d9 (diff)
Prevent crashing the compositor when the client wants to unset the cursor.
Change-Id: I40460110e24555aacaef928af32372c32a3291d1 Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlinputdevice.cpp')
-rw-r--r--src/compositor/wayland_wrapper/wlinputdevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp
index c3e977ead..41cbc3806 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<InputDevice>(pointer->seat);
wl_buffer *buffer = reinterpret_cast<wl_buffer *>(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);
}
}