[PATCH weston 1/2] xwm: Fail safely if cursor is not found

Tiago Vignatti tiago.vignatti at intel.com
Fri Sep 28 06:29:46 PDT 2012


It will use the stock 'x' cursor instead when the system cursors are not
provided.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
On my tree I've implemented a fallback on pre-made cursor for the "left_ptr",
which is the only one being used there:

http://cgit.freedesktop.org/~vignatti/weston/commit/?h=xwm-client&id=cf4abbde09edb373a3277a17dbdca80e076d09fb

 src/xwayland/window-manager.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index f5571a5..4b1ab98 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -206,6 +206,9 @@ xcb_cursor_library_load_cursor(struct weston_wm *wm, const char *file)
 		size = 32;
 
 	images = XcursorLibraryLoadImages (file, NULL, size);
+	if (!images)
+		return -1;
+
 	cursor = xcb_cursor_images_load_cursor (wm, images);
 	XcursorImagesDestroy (images);
 
-- 
1.7.9.5



More information about the wayland-devel mailing list