patches/gnome-desktop-05-randr-xerror.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 17683 b4b88b042273
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17683
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
     1
diff -ruN gnome-desktop-2.29.92.orig/libgnome-desktop/gnome-rr.c gnome-desktop-2.29.92/libgnome-desktop/gnome-rr.c
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
     2
--- gnome-desktop-2.29.92.orig/libgnome-desktop/gnome-rr.c	2010-03-11 22:09:56.932337306 +0000
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
     3
+++ gnome-desktop-2.29.92/libgnome-desktop/gnome-rr.c	2010-03-11 22:11:46.392023217 +0000
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
     4
@@ -740,12 +740,25 @@
13516
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     5
 			  int       mm_width,
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     6
 			  int       mm_height)
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     7
 {
17683
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
     8
+
13516
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     9
+    gint errcode = 0;
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    10
     g_return_if_fail (screen != NULL);
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    11
+    /* As a temporary fix to work around an issue in X where this call is
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    12
+     * succeeding yet still generating an XError, we will trap any such error,
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    13
+     * and write out a warning - better than crashing g-s-d.
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    14
+     */
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    15
+    gdk_error_trap_push();
17683
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
    16
 
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
    17
 #ifdef HAVE_RANDR
13516
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    18
     XRRSetScreenSize (screen->xdisplay, screen->xroot,
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    19
 		      width, height, mm_width, mm_height);
17683
b4b88b042273 2010-03-11 Christian Kelly <[email protected]>
chrisk
parents: 13516
diff changeset
    20
 #endif
13516
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    21
+
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    22
+    gdk_flush (); /* Get XErrors now, if any */
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    23
+
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    24
+    if ( (errcode = gdk_error_trap_pop()) != 0 ) {
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    25
+        g_warning( G_STRLOC ": XRRSetScreenSize generated an XError: %d", errcode );
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    26
+    }
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    27
 }
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    28
 
e4d876d4f667 2008-09-10 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    29
 void