[gnome-shell] shell: fail cleanly if XFixesGetCursorImage fails



commit 3dc07d48c53146b4b936a35967fd700b3a54a611
Author: Dan Winship <danw gnome org>
Date:   Wed Aug 3 11:12:32 2011 -0400

    shell: fail cleanly if XFixesGetCursorImage fails
    
    from Mageia, via Olav Vitters
    https://bugzilla.gnome.org/show_bug.cgi?id=653119

 src/shell-recorder.c      |    2 ++
 src/shell-xfixes-cursor.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index 0171045..9df14d3 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -393,6 +393,8 @@ recorder_fetch_cursor_image (ShellRecorder *recorder)
     return;
 
   cursor_image = XFixesGetCursorImage (clutter_x11_get_default_display ());
+  if (!cursor_image)
+    return;
 
   recorder->cursor_hot_x = cursor_image->xhot;
   recorder->cursor_hot_y = cursor_image->yhot;
diff --git a/src/shell-xfixes-cursor.c b/src/shell-xfixes-cursor.c
index 0da2397..6507d19 100644
--- a/src/shell-xfixes-cursor.c
+++ b/src/shell-xfixes-cursor.c
@@ -202,6 +202,8 @@ xfixes_cursor_reset_image (ShellXFixesCursor *xfixes_cursor)
     return;
 
   cursor_image = XFixesGetCursorImage (clutter_x11_get_default_display ());
+  if (!cursor_image)
+    return;
 
   /* Like all X APIs, XFixesGetCursorImage() returns arrays of 32-bit
    * quantities as arrays of long; we need to convert on 64 bit */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]