[comp.windows.x] V10R4 XTERM - bug in icon positioning ...

jmsellens@watmath.waterloo.edu.UUCP (02/18/87)

If you don't specify a place for the icon, xterm puts its location at the
middle of the text window.  This doesn't work too well if you create
the window with its centre off screen - iconify the window and you
can't get it back (not easily at least).  This is what I did to
charproc.c at line 1632:

	if(screen->iconTwin.window) {
		XQueryWindow(screen->iconTwin.window, &wininfo);
		x = wininfo.x;
		y = wininfo.y;
	} else {
		x = twindow.x + (twindow.width - screen->iconVwin.width) / 2;
		y = twindow.y + (twindow.height - screen->iconVwin.height) / 2;
		IconGeometry(screen, &x, &y);
	}
#ifdef waterloo
	/* no matter what they ask for, don't let them set the location
	   for the icon off the screen */
	if ( x <= -screen->iconVwin.width+10 ) x = -screen->iconVwin.width+10;
	if ( x > DisplayWidth()-10 ) x = DisplayWidth()-10;
	if ( y <= -screen->iconVwin.height+10 ) y = -screen->iconVwin.height+10;
	if ( y > DisplayHeight()-10 ) y = DisplayHeight()-10;
#endif
	screen->iconVwin.window =
		XCreateWindow( RootWindow, x, y, 1, 1, screen->borderwidth,
			       screen->bordertile, screen->bgndtile );