From: Philipp Brüschweiler Date: Mon, 13 Aug 2012 18:04:54 +0000 (+0200) Subject: dnd: fix segfault on grabbing X-Git-Tag: submit/trunk/20120814.155504~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f22d0ecd97644e7b6526128c3449f0e080188b26;p=profile%2Fivi%2Fweston.git dnd: fix segfault on grabbing Some cursor themes don't include a "grabbing" icon, causing a segfault. This patch fixes this by just reverting to the stardard cursor instead. https://bugs.freedesktop.org/show_bug.cgi?id=50487 --- diff --git a/clients/dnd.c b/clients/dnd.c index 6f55e95..44c1541 100644 --- a/clients/dnd.c +++ b/clients/dnd.c @@ -20,6 +20,7 @@ * OF THIS SOFTWARE. */ +#include #include #include #include @@ -327,6 +328,12 @@ create_drag_cursor(struct dnd_drag *dnd_drag, cairo_t *cr; pointer = display_get_pointer_image(dnd->display, CURSOR_DRAGGING); + if (!pointer) { + fprintf(stderr, "WARNING: grabbing cursor image not found\n"); + pointer = display_get_pointer_image(dnd->display, + CURSOR_LEFT_PTR); + assert(pointer && "no cursor image found"); + } rectangle.width = item_width + 2 * pointer->width; rectangle.height = item_height + 2 * pointer->height;