[509] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

Patches for zwgc and X11R5

daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Mon Sep 27 10:58:55 1993

From: epeisach@MIT.EDU
Date: Mon, 27 Sep 93 10:58:43 -0400
To: bug-zephyr@MIT.EDU, bugs@MIT.EDU



In R5, certain structures of the Display structure are now private and
cannot be gotten at directly.... Since R3, one of these structres has
had a procedure to provide such functionallity.... (the xdefaults one) I
simply decided to test for R5, although R3 would have been sufficient.

The display->display_name needs to be replace with
DisplayString(display). This will not work with X10, but then again,
with X10, display_name was not an element of the structure and nothing
is lost.

	Ezra

===================================================================
RCS file: RCS/X_driver.c,v
retrieving revision 1.13
diff -c -r1.13 X_driver.c
*** 1.13	1992/04/24 14:36:27
--- X_driver.c	1993/09/27 14:54:35
***************
*** 247,253 ****
       char **argv;
  {
      XrmDatabase temp_db1, temp_db2, temp_db3;
!     char *filename, *res;
      extern char *getenv();
  
      /* Initialize X resource manager: */
--- 247,253 ----
       char **argv;
  {
      XrmDatabase temp_db1, temp_db2, temp_db3;
!     char *filename, *res, *xdef;
      extern char *getenv();
  
      /* Initialize X resource manager: */
***************
*** 273,281 ****
  
      /*
       * Get resources from the just opened display:
       */
!     if (dpy->xdefaults != NULL)
! 	temp_db2 = XrmGetStringDatabase(dpy->xdefaults);
      else
  	temp_db2 = NULL;
  
--- 273,287 ----
  
      /*
       * Get resources from the just opened display:
+      * In X11R5 we must use the proper X call - the data is private
       */
! #if XlibSpecificationRelease > 4
!     xdef = XResourceManagerString(dpy);
! #else
!     xdef = dpy->xdefaults;
! #endif
!     if (xdef != NULL)
! 	temp_db2 = XrmGetStringDatabase(xdef);
      else
  	temp_db2 = NULL;
  
***************
*** 324,330 ****
  {
      extern void finalize_zephyr();
  
!     ERROR2("X IO error on display '%s'--exiting\n", display->display_name);
      finalize_zephyr();
      exit(1);
  }
--- 330,336 ----
  {
      extern void finalize_zephyr();
  
!     ERROR2("X IO error on display '%s'--exiting\n", DisplayString(display));
      finalize_zephyr();
      exit(1);
  }

home help back first fref pref prev next nref lref last post