[5883] in Athena Bugs

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

Fix: 7.1 emacs -iconGeometry or negative coord not parsed right

daemon@ATHENA.MIT.EDU (epeisach@ATHENA.MIT.EDU)
Tue Aug 28 17:43:36 1990

From: epeisach@ATHENA.MIT.EDU
Date: Tue, 28 Aug 90 17:43:24 -0400
To: bugs@ATHENA.MIT.EDU


Richard sent in a bug a while ago about icon geometries not being parsed
correctly. I believe that the problem was that when specifying a
negative geometry it was being interpreted as offset from 0,0 because it
was using XParseGeometry. X geometry is better in that it takes into
account the default window size. 

Sample code stolen from xterm/main.c (yeah I know great example but....)

	Ezra

Fix follows:

RCS file: RCS/x11term.c,v
retrieving revision 1.2
diff -c -r1.2 x11term.c
*** /tmp/,RCSt1002596	Tue Aug 28 17:41:23 1990
--- x11term.c	Tue Aug 28 17:35:53 1990
***************
*** 1695,1702 ****
      BLOCK_INPUT_DECLARE ();
      Arg arglist[20];
      int i;
!     int pr, xpos, ypos;
!     unsigned int width, height;
      static char newgeom[64]; /* static because shell widget doesn't copy it */
      
      BLOCK_INPUT ();
--- 1695,1701 ----
      BLOCK_INPUT_DECLARE ();
      Arg arglist[20];
      int i;
!     int pr, xpos, ypos, width, height;
      static char newgeom[64]; /* static because shell widget doesn't copy it */
      
      BLOCK_INPUT ();
***************
*** 1715,1724 ****
      }
  
      if (XXemacswidget->local.icon_geometry) {
! 	pr = XParseGeometry(XXemacswidget->local.icon_geometry, 
! 			    &xpos, &ypos, &width, &height);
! 	XtSetArg(arglist[i], XtNiconX, (Position) xpos); i++;
!         XtSetArg(arglist[i], XtNiconY, (Position) ypos); i++;
      }
  
      if (XXemacswidget->local.icon_usebitmap) {
--- 1714,1724 ----
      }
  
      if (XXemacswidget->local.icon_geometry) {
! 	pr = XGeometry(XXdisplay, XXscreen, 
! 		       XXemacswidget->local.icon_geometry, "",
! 		       0, 0, 0, 0, 0, &xpos, &ypos, &width, &height);
! 	XtSetArg(arglist[i], XtNiconX, (XtArgVal) xpos); i++;
!         XtSetArg(arglist[i], XtNiconY, (XtArgVal) ypos); i++;
      }
  
      if (XXemacswidget->local.icon_usebitmap) {

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