GNOME Bugzilla – Bug 554263
XRandR support can not be disabled
Last modified: 2010-02-23 03:04:27 UTC
Please describe the problem: With Linux Redhat EL4, XRandR 1.2 is not available (only 1.1). Because it is not possible to disable XRandR features of libgnome-desktop, Gnome 2.24.0 can not be compiled on this kind of box. It should be possible to enable/disable XRandR using gnome-desktop configure script. Steps to reproduce: 1. Using garnome-2.24.0, run make in gnome-desktop folder Actual results: gnome-rr.c does not compile. I got these errors : gnome-rr.c:46: error: syntax error before "XRRScreenResources" gnome-rr.c:46: warning: no semicolon at end of struct or union gnome-rr.c:53: error: syntax error before '}' token gnome-rr.c:73: error: syntax error before "RROutput" gnome-rr.c:73: warning: no semicolon at end of struct or union gnome-rr.c:85: error: syntax error before '}' token gnome-rr.c:89: error: syntax error before "RROutput" gnome-rr.c:89: warning: no semicolon at end of struct or union gnome-rr.c:95: error: syntax error before "RRCrtc" gnome-rr.c:95: warning: no semicolon at end of struct or union gnome-rr.c:105: error: syntax error before '}' token gnome-rr.c:110: error: syntax error before "RRMode" gnome-rr.c:110: warning: no semicolon at end of struct or union gnome-rr.c:115: error: syntax error before '}' token gnome-rr.c:119: error: syntax error before "RRCrtc" gnome-rr.c:122: error: syntax error before "XRRScreenResources" gnome-rr.c:126: error: syntax error before "RROutput" gnome-rr.c:128: error: syntax error before "XRRScreenResources" gnome-rr.c:133: error: syntax error before "RRMode" gnome-rr.c:135: error: syntax error before "XRRModeInfo" gnome-rr.c:141: error: syntax error before "RROutput" gnome-rr.c: In function `gnome_rr_output_by_id': gnome-rr.c:145: error: `info' undeclared (first use in this function) gnome-rr.c:145: error: (Each undeclared identifier is reported only once gnome-rr.c:145: error: for each function it appears in.) gnome-rr.c:149: error: dereferencing pointer to incomplete type gnome-rr.c:149: error: `id' undeclared (first use in this function) gnome-rr.c: At top level: gnome-rr.c:157: error: syntax error before "RRCrtc" gnome-rr.c: In function `crtc_by_id': gnome-rr.c:161: error: `info' undeclared (first use in this function) gnome-rr.c:166: error: dereferencing pointer to incomplete type gnome-rr.c:166: error: `id' undeclared (first use in this function) gnome-rr.c: At top level: gnome-rr.c:174: error: syntax error before "RRMode" gnome-rr.c: In function `mode_by_id': gnome-rr.c:178: error: `info' undeclared (first use in this function) gnome-rr.c:182: error: dereferencing pointer to incomplete type gnome-rr.c:182: error: `id' undeclared (first use in this function) gnome-rr.c: In function `screen_info_free': gnome-rr.c:198: error: dereferencing pointer to incomplete type gnome-rr.c:200: warning: implicit declaration of function `XRRFreeScreenResources' gnome-rr.c:200: warning: nested extern declaration of `XRRFreeScreenResources' gnome-rr.c:200: error: dereferencing pointer to incomplete type gnome-rr.c:202: error: dereferencing pointer to incomplete type gnome-rr.c:205: error: dereferencing pointer to incomplete type gnome-rr.c:207: error: dereferencing pointer to incomplete type gnome-rr.c:209: error: dereferencing pointer to incomplete type gnome-rr.c:212: error: dereferencing pointer to incomplete type gnome-rr.c:214: error: dereferencing pointer to incomplete type gnome-rr.c:216: error: dereferencing pointer to incomplete type gnome-rr.c:219: error: dereferencing pointer to incomplete type gnome-rr.c:221: error: dereferencing pointer to incomplete type gnome-rr.c:223: error: dereferencing pointer to incomplete type gnome-rr.c: In function `fill_out_screen_info': gnome-rr.c:234: error: `XRRScreenResources' undeclared (first use in this function) gnome-rr.c:234: error: `resources' undeclared (first use in this function) gnome-rr.c:241: warning: implicit declaration of function `XRRGetScreenSizeRange' gnome-rr.c:241: warning: nested extern declaration of `XRRGetScreenSizeRange' gnome-rr.c:242: error: dereferencing pointer to incomplete type gnome-rr.c:243: error: dereferencing pointer to incomplete type gnome-rr.c:244: error: dereferencing pointer to incomplete type gnome-rr.c:245: error: dereferencing pointer to incomplete type gnome-rr.c:263: warning: implicit declaration of function `XRRGetScreenResources' gnome-rr.c:263: warning: nested extern declaration of `XRRGetScreenResources' gnome-rr.c:277: error: dereferencing pointer to incomplete type gnome-rr.c:290: error: dereferencing pointer to incomplete type gnome-rr.c:300: error: dereferencing pointer to incomplete type gnome-rr.c:310: error: dereferencing pointer to incomplete type gnome-rr.c:313: error: dereferencing pointer to incomplete type gnome-rr.c:316: error: dereferencing pointer to incomplete type gnome-rr.c: In function `screen_info_new': gnome-rr.c:341: error: invalid application of `sizeof' to incomplete type `gnome-rr.c' gnome-rr.c:345: error: dereferencing pointer to incomplete type gnome-rr.c:346: error: dereferencing pointer to incomplete type gnome-rr.c:347: error: dereferencing pointer to incomplete type gnome-rr.c:348: error: dereferencing pointer to incomplete type gnome-rr.c: In function `screen_update': gnome-rr.c:372: error: dereferencing pointer to incomplete type gnome-rr.c:372: error: dereferencing pointer to incomplete type gnome-rr.c: In function `screen_on_event': gnome-rr.c:394: error: `RRNotify' undeclared (first use in this function) gnome-rr.c:396: error: `XRRNotifyEvent' undeclared (first use in this function) gnome-rr.c:396: error: syntax error before ')' token gnome-rr.c:398: error: union has no member named `subtype' gnome-rr.c: In function `gnome_rr_screen_new': gnome-rr.c:451: error: `RRCrtcChangeNotifyMask' undeclared (first use in this function) gnome-rr.c:452: error: `RROutputPropertyNotifyMask' undeclared (first use in this function) gnome-rr.c:457: error: `RRNotify' undeclared (first use in this function) gnome-rr.c: In function `gnome_rr_screen_set_size': gnome-rr.c:488: warning: implicit declaration of function `XRRSetScreenSize' gnome-rr.c:488: warning: nested extern declaration of `XRRSetScreenSize' gnome-rr.c: In function `gnome_rr_screen_get_ranges': gnome-rr.c:502: error: dereferencing pointer to incomplete type gnome-rr.c:505: error: dereferencing pointer to incomplete type gnome-rr.c:508: error: dereferencing pointer to incomplete type gnome-rr.c:511: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_list_modes': gnome-rr.c:526: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_list_crtcs': gnome-rr.c:535: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_list_outputs': gnome-rr.c:544: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_get_crtc_by_id': gnome-rr.c:556: error: dereferencing pointer to incomplete type gnome-rr.c:558: error: dereferencing pointer to incomplete type gnome-rr.c:559: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_get_output_by_id': gnome-rr.c:574: error: dereferencing pointer to incomplete type gnome-rr.c:576: error: dereferencing pointer to incomplete type gnome-rr.c:577: error: dereferencing pointer to incomplete type gnome-rr.c: At top level: gnome-rr.c:585: error: syntax error before "RROutput" gnome-rr.c:586: warning: 'output_new' was used with no prototype before its definition gnome-rr.c: In function `output_new': gnome-rr.c:587: error: invalid application of `sizeof' to incomplete type `libgnomeui/gnome-rr.h' gnome-rr.c:589: error: dereferencing pointer to incomplete type gnome-rr.c:589: error: `id' undeclared (first use in this function) gnome-rr.c:590: error: dereferencing pointer to incomplete type gnome-rr.c:590: error: `info' undeclared (first use in this function) gnome-rr.c: At top level: gnome-rr.c:597: error: syntax error before "RROutput" gnome-rr.c: In function `get_property': gnome-rr.c:607: warning: implicit declaration of function `XRRGetOutputProperty' gnome-rr.c:607: warning: nested extern declaration of `XRRGetOutputProperty' gnome-rr.c:607: error: `dpy' undeclared (first use in this function) gnome-rr.c:607: error: `output' undeclared (first use in this function) gnome-rr.c:607: error: `atom' undeclared (first use in this function) gnome-rr.c:616: error: `len' undeclared (first use in this function) gnome-rr.c: In function `read_edid_data': gnome-rr.c:632: error: dereferencing pointer to incomplete type gnome-rr.c:636: error: dereferencing pointer to incomplete type gnome-rr.c:637: error: dereferencing pointer to incomplete type gnome-rr.c: At top level: gnome-rr.c:651: error: syntax error before "XRRScreenResources" gnome-rr.c:652: warning: 'output_initialize' was used with no prototype before its definition gnome-rr.c: In function `output_initialize': gnome-rr.c:653: error: `XRROutputInfo' undeclared (first use in this function) gnome-rr.c:653: error: `info' undeclared (first use in this function) gnome-rr.c:653: warning: implicit declaration of function `XRRGetOutputInfo' gnome-rr.c:653: warning: nested extern declaration of `XRRGetOutputInfo' gnome-rr.c:654: error: `output' undeclared (first use in this function) gnome-rr.c:654: error: `res' undeclared (first use in this function) gnome-rr.c:672: error: `RR_Connected' undeclared (first use in this function) gnome-rr.c:716: warning: implicit declaration of function `XRRFreeOutputInfo' gnome-rr.c:716: warning: nested extern declaration of `XRRFreeOutputInfo' gnome-rr.c: In function `gnome_rr_output_get_id': gnome-rr.c:730: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_edid_data': gnome-rr.c:738: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_screen_get_output_by_name': gnome-rr.c:750: error: dereferencing pointer to incomplete type gnome-rr.c:752: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c:754: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_crtc': gnome-rr.c:766: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_name': gnome-rr.c:799: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_width_mm': gnome-rr.c:806: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_height_mm': gnome-rr.c:813: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_get_preferred_mode': gnome-rr.c:820: error: dereferencing pointer to incomplete type gnome-rr.c:821: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_list_modes': gnome-rr.c:830: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_is_connected': gnome-rr.c:837: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_supports_mode': gnome-rr.c:849: error: dereferencing pointer to incomplete type gnome-rr.c:851: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_output_can_clone': gnome-rr.c:867: error: dereferencing pointer to incomplete type gnome-rr.c:869: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_set_config': gnome-rr.c:940: error: dereferencing pointer to incomplete type gnome-rr.c:944: error: dereferencing pointer to incomplete type gnome-rr.c:944: error: dereferencing pointer to incomplete type gnome-rr.c:945: error: dereferencing pointer to incomplete type gnome-rr.c:945: error: dereferencing pointer to incomplete type gnome-rr.c:948: error: `RROutput' undeclared (first use in this function) gnome-rr.c:953: error: dereferencing pointer to incomplete type gnome-rr.c:956: warning: implicit declaration of function `XRRSetCrtcConfig' gnome-rr.c:956: warning: nested extern declaration of `XRRSetCrtcConfig' gnome-rr.c:956: error: dereferencing pointer to incomplete type gnome-rr.c:956: error: dereferencing pointer to incomplete type gnome-rr.c:956: error: dereferencing pointer to incomplete type gnome-rr.c:959: error: dereferencing pointer to incomplete type gnome-rr.c:961: error: syntax error before ')' token gnome-rr.c: In function `gnome_rr_crtc_get_current_mode': gnome-rr.c:974: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_get_id': gnome-rr.c:982: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_can_drive_output': gnome-rr.c:994: error: dereferencing pointer to incomplete type gnome-rr.c:996: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_get_position': gnome-rr.c:1012: error: dereferencing pointer to incomplete type gnome-rr.c:1015: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_get_current_rotation': gnome-rr.c:1023: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_get_rotations': gnome-rr.c:1030: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_crtc_supports_rotation': gnome-rr.c:1038: error: dereferencing pointer to incomplete type gnome-rr.c: At top level: gnome-rr.c:1042: error: syntax error before "RROutput" gnome-rr.c:1043: warning: 'crtc_new' was used with no prototype before its definition gnome-rr.c: In function `crtc_new': gnome-rr.c:1044: error: invalid application of `sizeof' to incomplete type `libgnomeui/gnome-rr.h' gnome-rr.c:1046: error: dereferencing pointer to incomplete type gnome-rr.c:1046: error: `id' undeclared (first use in this function) gnome-rr.c:1047: error: dereferencing pointer to incomplete type gnome-rr.c:1047: error: `info' undeclared (first use in this function) gnome-rr.c: At top level: gnome-rr.c:1054: error: syntax error before "XRRScreenResources" gnome-rr.c:1055: warning: 'crtc_initialize' was used with no prototype before its definition gnome-rr.c: In function `crtc_initialize': gnome-rr.c:1056: error: `XRRCrtcInfo' undeclared (first use in this function) gnome-rr.c:1056: error: `info' undeclared (first use in this function) gnome-rr.c:1056: warning: implicit declaration of function `XRRGetCrtcInfo' gnome-rr.c:1056: warning: nested extern declaration of `XRRGetCrtcInfo' gnome-rr.c:1056: error: `crtc' undeclared (first use in this function) gnome-rr.c:1056: error: `res' undeclared (first use in this function) gnome-rr.c:1104: warning: implicit declaration of function `XRRFreeCrtcInfo' gnome-rr.c:1104: warning: nested extern declaration of `XRRFreeCrtcInfo' gnome-rr.c: In function `crtc_free': gnome-rr.c:1110: error: dereferencing pointer to incomplete type gnome-rr.c:1111: error: dereferencing pointer to incomplete type gnome-rr.c: At top level: gnome-rr.c:1117: error: syntax error before "RRMode" gnome-rr.c:1118: warning: 'mode_new' was used with no prototype before its definition gnome-rr.c: In function `mode_new': gnome-rr.c:1119: error: invalid application of `sizeof' to incomplete type `libgnomeui/gnome-rr.h' gnome-rr.c:1121: error: dereferencing pointer to incomplete type gnome-rr.c:1121: error: `id' undeclared (first use in this function) gnome-rr.c:1122: error: dereferencing pointer to incomplete type gnome-rr.c:1122: error: `info' undeclared (first use in this function) gnome-rr.c: In function `gnome_rr_mode_get_id': gnome-rr.c:1131: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_mode_get_width': gnome-rr.c:1138: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_mode_get_freq': gnome-rr.c:1145: error: dereferencing pointer to incomplete type gnome-rr.c: In function `gnome_rr_mode_get_height': gnome-rr.c:1152: error: dereferencing pointer to incomplete type gnome-rr.c: At top level: gnome-rr.c:1156: error: syntax error before "XRRModeInfo" gnome-rr.c:1157: warning: 'mode_initialize' was used with no prototype before its definition gnome-rr.c: In function `mode_initialize': gnome-rr.c:1158: error: `mode' undeclared (first use in this function) gnome-rr.c:1159: error: `info' undeclared (first use in this function) gnome-rr.c: In function `mode_free': gnome-rr.c:1170: error: dereferencing pointer to incomplete type Expected results: gnome-desktop should compile with limited features due to XRandR wrong version. Does this happen every time? Other information:
Also seen by me on macports (Mac OS X 10.4.11/PPC)
Macports bug dependent on this one: https://trac.macports.org/ticket/16720 Also seen: http://live.gnome.org/JhbuildIssues/gnome-desktop
Even on OS X 10.5, where xrandr.pc claims to be version 1.2, we can't compile. The xrandr doesn't have the RRN* stuff (either it's explicitly disabled during the xrandr build or else it's actually only an older version that doesn't have this new-in-1.2 API).
Was this fixed by bug 553762 or bug 549182?
Bug 553762 deals with a missing runtime extension in the server following a successful compile (can't get that far!). Bug 549182 deals with mis-nondetection or mis-failing if the new version of xrandr lib is not available. That makes the failure happen earlier in the build process and gives a more polite error message. But the bottom line is the same I fear: Xrandr is not always available and/or is only an older version, but gnome-desktop appears to have a mandatory dependency on new-version xrandr.
(In reply to comment #5) > Xrandr is > not always available and/or is only an older version, but gnome-desktop appears > to have a mandatory dependency on new-version xrandr. ...and the request is to have it optional. sounds more like an enhancement request to me, then.
"Make this package, which is a dependency of multiple other parts of gnome, be compilable at all on several platforms where it presently isn't" sounds a lot like the definition of blocker. I don't mean to be sarcastic here, but otherwise *every* bugzilla is "enhancement: no longer have this crasher bug", etc. It appears that XRandR was only added as of gnome-desktop-2.24 (or during the .23 development...svn revision 5121) as a self-contained chunk of new API and that is explicitly unstable (per GNOME_DESKTOP_USE_UNSTABLE_API protection in the new *-rr*.h). That would mean (please correct me, I didn't analyze the rest of the sources) "the whole XRandR stuff" (or "the part that needs 1.2") could be disabled without affecting the other parts of gnome-desktop. So a --without-xrandr or somesuch toggle could scrap those sources and installed headers (or stub functions, or headers that #error 'disabled API') would give a viable (though slightly castrated) gnome-desktop library?
Patch welcome -- I would guess it's actually a bit more complex than not compiling stuff but installing headers since modules relying on this will fail (gnome-settings-daemon & gnome-control-center, eg). Maybe having some stub functions is easy, but someone needs to look at it.
If we disable RANDR features based on whether libXrandr >= 1.2, then I'd like the following to happen: 1. gnome-desktop: gnome_rr_screen_new() returns NULL and a GError saying "RANDR 1.2 extension is not present". There is already a check for no RANDR at runtime, just not for the right version. 2. gnome-settings-daemon: it has a check for the RANDR libraries in configure.ac, includes Xrandr.h, and links to libXrandr. None of that is needed, as we have the wrappers in gnome-desktop --- feel free to remove that stuff. 3. gnome-control-center: It links the display capplet with libXrandr, but it doesn't actually need to do that - same as gnome-settings-daemon.
*** Bug 584167 has been marked as a duplicate of this bug. ***
Created attachment 135582 [details] modified according to suggestions by Federico Mena Quintero Federico Mena Quintero suggested modifications to my patch as referred to in my duplicate bug #584167. I'm attaching a new version of the gnome-rr.c rather than a patch since a patch would probably be too chaotic and not illuminating. I moved a bunch of internal functions around to bring them in a single #if block. The non-static functions are mostly stubbed out and do nothing, except return dummy values to keep the compiler happy. It compiles for me, but I have no easy way of determining if it compiles when HAVE_RANDR_1_2 is 1.
It seems that in the file gnome-rr-private.h, the line #if HAVE_RANDR_1_2 XRRScreenResources *resources; #endif needs to be stubbed out too (as shown). Even though I don't include it in gnome-rr.c, it is apparently included in gnome-rr-config.c as well.
*** Bug 566860 has been marked as a duplicate of this bug. ***
*** Bug 586394 has been marked as a duplicate of this bug. ***
A patch that only handles the runtime aspect (running against a randr < 1.2 X server) can be found in bug 606457
*** Bug 606457 has been marked as a duplicate of this bug. ***
*** Bug 598482 has been marked as a duplicate of this bug. ***
*** Bug 601980 has been marked as a duplicate of this bug. ***
Here is an updated version of my patch from bug 606457
Created attachment 153938 [details] [review] check for new enough randr
Fixed in commit 25268c607. Thanks for the patches, Matthias and rhialto. gnome-settings-daemon is fixed in commit f0df8073a. gnome-control-center is fixed in commit 4b224e492.
*** Bug 600188 has been marked as a duplicate of this bug. ***