xfreerdp: fix building without XCursor support
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Sat, 27 Oct 2012 19:01:22 +0000 (15:01 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Sat, 27 Oct 2012 19:01:22 +0000 (15:01 -0400)
client/X11/xf_graphics.c

index f39aea1..865f608 100644 (file)
@@ -203,6 +203,7 @@ void xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary)
 
 void xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
 {
+#ifdef WITH_XCURSOR
        XcursorImage ci;
        xfInfo* xfi = ((xfContext*) context)->xfi;
 
@@ -222,29 +223,36 @@ void xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
        }
 
        ((xfPointer*) pointer)->cursor = XcursorImageLoadCursor(xfi->display, &ci);
+
        free(ci.pixels);
+#endif
 }
 
 void xf_Pointer_Free(rdpContext* context, rdpPointer* pointer)
 {
+#ifdef WITH_XCURSOR
        xfInfo* xfi = ((xfContext*) context)->xfi;
 
        if (((xfPointer*) pointer)->cursor != 0)
                XFreeCursor(xfi->display, ((xfPointer*) pointer)->cursor);
+#endif
 }
 
 void xf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
 {
+#ifdef WITH_XCURSOR
        xfInfo* xfi = ((xfContext*) context)->xfi;
 
        /* in RemoteApp mode, window can be null if none has had focus */
 
        if (xfi->window != NULL)
                XDefineCursor(xfi->display, xfi->window->handle, ((xfPointer*) pointer)->cursor);
+#endif
 }
 
 void xf_Pointer_SetNull(rdpContext* context)
 {
+#ifdef WITH_XCURSOR
        xfInfo* xfi = ((xfContext*) context)->xfi;
        static Cursor nullcursor = None;
 
@@ -260,16 +268,20 @@ void xf_Pointer_SetNull(rdpContext* context)
                ci.pixels = &xp;
                nullcursor = XcursorImageLoadCursor(xfi->display, &ci);
        }
+
        if (xfi->window != NULL && nullcursor != None)
                XDefineCursor(xfi->display, xfi->window->handle, nullcursor);
+#endif
 }
 
 void xf_Pointer_SetDefault(rdpContext* context)
 {
+#ifdef WITH_XCURSOR
        xfInfo* xfi = ((xfContext*) context)->xfi;
 
        if (xfi->window != NULL)
                XUndefineCursor(xfi->display, xfi->window->handle);
+#endif
 }
 
 /* Glyph Class */