[ubuntu-x] [PATCH 5/15] gnome-desktop: Null ptr check #3

Bryce Harrington bryce at canonical.com
Thu Apr 10 20:55:39 BST 2008


gnome-desktop:  106_gd-randr-fix-xgl.patch (LP: #199960)

This patch catches the NULL pointer that was causing g-s-d to crash when
used with Xgl.  The g_prints were disabled as they were complaining that
"%d couldn't be used for type Window".  Patch is thanks to James Westby,
who also verified it works on Xgl.


diff -Nur -x '*.orig' -x '*~' gnome-desktop-2.22.1/libgnome-desktop/randrwrap.c gnome-desktop-2.22.1.new/libgnome-desktop/randrwrap.c
--- gnome-desktop-2.22.1/libgnome-desktop/randrwrap.c	2008-04-10 11:05:13.000000000 +0100
+++ gnome-desktop-2.22.1.new/libgnome-desktop/randrwrap.c	2008-04-10 11:05:21.000000000 +0100
@@ -220,7 +220,7 @@
                                 &(info->max_width),
                                 &(info->max_height))) {
         /* XRR caught an error */
-        g_print("Error:  X was unable to determine screen size range for window %d\n", xroot);
+        //g_print("Error:  X was unable to determine screen size range for window %d\n", xroot);
         return False;
     }
 
@@ -228,7 +228,7 @@
     if (gdk_error_trap_pop ())
     {
         /* Unhandled X Error was generated */
-        g_print("Error:  X Error received when attempting to get screen size range for window %d\n", xroot);
+        //g_print("Error:  X Error received when attempting to get screen size range for window %d\n", xroot);
         return False;
     }
 
@@ -424,7 +424,10 @@
 	screen->randr_event_base = event_base;
 
 	screen->info = screen_info_new (screen);
-	
+
+	if (!(screen->info))
+		return NULL;
+
 	XRRSelectInput (screen->xdisplay,
 			screen->xroot,
 			RRScreenChangeNotifyMask	|



More information about the Ubuntu-x mailing list