[mutter] cursor-renderer/native: Fix Xcursor image loading error handling



commit 6c7c566c6c58648d000d2c7947cd33f8935d2709
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed May 2 16:56:14 2018 +0200

    cursor-renderer/native: Fix Xcursor image loading error handling
    
    Check the return value whether there was an error, and change to
    g_warning to warn while at it.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/77

 src/backends/meta-cursor-sprite-xcursor.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-cursor-sprite-xcursor.c b/src/backends/meta-cursor-sprite-xcursor.c
index f30446695..bd5d6a94a 100644
--- a/src/backends/meta-cursor-sprite-xcursor.c
+++ b/src/backends/meta-cursor-sprite-xcursor.c
@@ -149,10 +149,9 @@ load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
                                            rowstride,
                                            (uint8_t *) xc_image->pixels,
                                            &error);
-
-  if (error)
+  if (!texture)
     {
-      meta_warning ("Failed to allocate cursor texture: %s\n", error->message);
+      g_warning ("Failed to allocate cursor texture: %s\n", error->message);
       cogl_error_free (error);
     }
 


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