*** xv.h-dist	Tue Mar 28 00:25:49 2000
--- xv.h	Tue Mar 28 03:25:27 2000
***************
*** 575,581 ****
  #define RM_CBRICK  7     /* centered on a 'brick' bg */
  #define RM_ECENTER 8     /* symmetrical tiled */
  #define RM_ECMIRR  9     /* symmetrical mirror tiled */
! #define RM_MAX     RM_ECMIRR
  
  
  /* values of colorMapMode */
--- 575,582 ----
  #define RM_CBRICK  7     /* centered on a 'brick' bg */
  #define RM_ECENTER 8     /* symmetrical tiled */
  #define RM_ECMIRR  9     /* symmetrical mirror tiled */
! #define RM_UPLEFT 10     /* just in upper left corner */
! #define RM_MAX     RM_UPLEFT
  
  
  /* values of colorMapMode */
***************
*** 625,631 ****
  #define RMB_CBRICK   8
  #define RMB_ECENTER  9
  #define RMB_ECMIRR   10
! #define RMB_MAX      11
  
  
  /* indicies into conv24MB */
--- 626,633 ----
  #define RMB_CBRICK   8
  #define RMB_ECENTER  9
  #define RMB_ECMIRR   10
! #define RMB_UPLEFT   11
! #define RMB_MAX      12
  
  
  /* indicies into conv24MB */
***************
*** 948,954 ****
  WHERE unsigned int  ncells, dispWIDE, dispHIGH, dispDEEP;
  WHERE unsigned int  vrWIDE, vrHIGH, maxWIDE, maxHIGH;
  WHERE Colormap      theCmap, LocalCmap;
! WHERE Window        rootW, mainW, vrootW;
  WHERE GC            theGC;
  WHERE u_long        black, white, fg, bg, infofg, infobg;
  WHERE u_long        hicol, locol;
--- 950,956 ----
  WHERE unsigned int  ncells, dispWIDE, dispHIGH, dispDEEP;
  WHERE unsigned int  vrWIDE, vrHIGH, maxWIDE, maxHIGH;
  WHERE Colormap      theCmap, LocalCmap;
! WHERE Window        spec_window, rootW, mainW, vrootW;
  WHERE GC            theGC;
  WHERE u_long        black, white, fg, bg, infofg, infobg;
  WHERE u_long        hicol, locol;
*** xv.c-dist	Tue Mar 28 00:22:38 2000
--- xv.c	Tue Mar 28 04:32:45 2000
***************
*** 313,319 ****
    
    theScreen = DefaultScreen(theDisp);
    theCmap   = DefaultColormap(theDisp, theScreen);
!   rootW     = RootWindow(theDisp,theScreen);
    theGC     = DefaultGC(theDisp,theScreen);
    theVisual = DefaultVisual(theDisp,theScreen);
    ncells    = DisplayCells(theDisp, theScreen);
--- 313,323 ----
    
    theScreen = DefaultScreen(theDisp);
    theCmap   = DefaultColormap(theDisp, theScreen);
!   if (spec_window) {
! 	rootW = spec_window;
!   } else {
!   	rootW = RootWindow(theDisp,theScreen);
!   }
    theGC     = DefaultGC(theDisp,theScreen);
    theVisual = DefaultVisual(theDisp,theScreen);
    ncells    = DisplayCells(theDisp, theScreen);
***************
*** 972,978 ****
    
    dispDEEP  = vinfo[best].depth;
    theScreen = vinfo[best].screen;
!   rootW     = RootWindow(theDisp, theScreen);
    ncells    = vinfo[best].colormap_size;
    theCmap   = XCreateColormap(theDisp, rootW, theVisual, AllocNone);
    
--- 976,986 ----
    
    dispDEEP  = vinfo[best].depth;
    theScreen = vinfo[best].screen;
!   if (spec_window) {
! 	rootW = spec_window;
!   } else {
!   	rootW = RootWindow(theDisp,theScreen);
!   }
    ncells    = vinfo[best].colormap_size;
    theCmap   = XCreateColormap(theDisp, rootW, theVisual, AllocNone);
    
***************
*** 1206,1211 ****
--- 1214,1227 ----
        }
      }
  
+     else if (!argcmp(argv[i],"-windowid",3,0,&pm)) {
+       if (++i<argc) {
+ 	if (sscanf(argv[i], "%ld", &spec_window) != 1) {
+ 		fprintf(stderr,"%s: bad argument to -windowid '%s'\n",cmd,argv[i]);
+         }
+       }
+     }
+ 
      else if (!argcmp(argv[i],"-best24",3,0,&pm))          /* -best */
        conv24 = CONV24_BEST;
      
***************
*** 1668,1673 ****
--- 1684,1690 ----
    printoption("[-/+vsperfect]");
    printoption("[-wait seconds]");
    printoption("[-white color]");
+   printoption("[-windowid windowid]");
    printoption("[-/+wloop]");
    printoption("[filename ...]");
    fprintf(stderr,"\n\n");
***************
*** 1690,1695 ****
--- 1707,1713 ----
    fprintf(stderr,"\t7: centered on a 'brick' background\n");
    fprintf(stderr,"\t8: symmetrical tiling\n");
    fprintf(stderr,"\t9: symmetrical mirrored tiling\n");
+   fprintf(stderr,"\t10: upper left corner\n");
    fprintf(stderr,"\n");
    Quit(1);
  }
***************
*** 4078,4093 ****
--- 4096,4125 ----
        unsigned long nitems, nleft;
        byte *data;
  
+       if (spec_window) {
+       i = XGetWindowProperty(theDisp, spec_window,
+ 			     resAtom, 0L, 1L, False, 
+ 			     XA_STRING, &actType, &actFormat, &nitems, &nleft, 
+ 			     (unsigned char **) &data);
+       } else {
        i = XGetWindowProperty(theDisp, RootWindow(theDisp, 0),
  			     resAtom, 0L, 1L, False, 
  			     XA_STRING, &actType, &actFormat, &nitems, &nleft, 
  			     (unsigned char **) &data);
+       }
        if (i==Success && actType==XA_STRING && actFormat==8) {
  	if (nitems>0 && data) XFree(data);
+         if (spec_window) {
+ 	i = XGetWindowProperty(theDisp, spec_window, resAtom, 0L, 
+ 			       (long) ((nleft+4+3)/4),
+ 			       False, XA_STRING, &actType, &actFormat, 
+ 			       &nitems, &nleft, (unsigned char **) &data);
+         } else {
  	i = XGetWindowProperty(theDisp, RootWindow(theDisp, 0), resAtom, 0L, 
  			       (long) ((nleft+4+3)/4),
  			       False, XA_STRING, &actType, &actFormat, 
  			       &nitems, &nleft, (unsigned char **) &data);
+         }
  	if (i==Success && actType==XA_STRING && actFormat==8 && data) {
  	  def_resource = XrmGetStringDatabase((char *) data);
  	  XFree(data);
*** xvctrl.c-dist	Tue Mar 28 03:38:51 2000
--- xvctrl.c	Tue Mar 28 03:37:57 2000
***************
*** 101,107 ****
  			     "Root: centered, warp",
  			     "Root: centered, brick",
      		             "Root: symmetrical tiled",
! 			     "Root: symmetrical mirrored" };
  
  static char *conv24MList[] = { "8-bit mode\t\2448",
  			       "24-bit mode\t\2448",
--- 101,108 ----
  			     "Root: centered, warp",
  			     "Root: centered, brick",
      		             "Root: symmetrical tiled",
! 			     "Root: symmetrical mirrored",
! 			     "Root: upper left corner" };
  
  static char *conv24MList[] = { "8-bit mode\t\2448",
  			       "24-bit mode\t\2448",
*** xvroot.c-dist	Tue Mar 28 02:36:01 2000
--- xvroot.c	Tue Mar 28 04:06:26 2000
***************
*** 44,49 ****
--- 44,50 ----
    case RM_MIRROR:
    case RM_IMIRROR: rpixw = 2*eWIDE;  rpixh = 2*eHIGH;  break;
    case RM_CSOLID:
+   case RM_UPLEFT:
    case RM_CWARP:
    case RM_CBRICK:  rpixw = dispWIDE; rpixh = dispHIGH; break;
  
***************
*** 101,107 ****
  
  
    else if (rmode == RM_CENTER || rmode == RM_CENTILE || rmode == RM_CSOLID ||
! 	   rmode == RM_CWARP || rmode == RM_CBRICK) {
      /* do some stuff to set up the border around the picture */
  
      if (rmode != RM_CENTILE) {
--- 102,108 ----
  
  
    else if (rmode == RM_CENTER || rmode == RM_CENTILE || rmode == RM_CSOLID ||
! 	   rmode == RM_CWARP || rmode == RM_CBRICK || rmode == RM_UPLEFT) {
      /* do some stuff to set up the border around the picture */
  
      if (rmode != RM_CENTILE) {
***************
*** 138,143 ****
--- 139,150 ----
  
      else if (rmode == RM_CSOLID) { }
  
+     else if (rmode == RM_UPLEFT) {
+ 
+       XPutImage(theDisp, tmpPix, theGC, theImage, 0,0, 0,0,
+ 		(u_int) eWIDE, (u_int) eHIGH);
+     }
+ 
      else if (rmode == RM_CWARP) {          /* warp effect */
        XSetForeground(theDisp, theGC, rootfg);
        for (i=0; i<=dispWIDE; i+=8) 
***************
*** 157,163 ****
  
  
      /* draw the image centered on top of the background */
!     if (rmode != RM_CENTILE) 
        XPutImage(theDisp, tmpPix, theGC, theImage, 0,0, 
  		((int) dispWIDE-eWIDE)/2, ((int) dispHIGH-eHIGH)/2, 
  		(u_int) eWIDE, (u_int) eHIGH);
--- 164,170 ----
  
  
      /* draw the image centered on top of the background */
!     if ((rmode != RM_CENTILE) && (rmode != RM_UPLEFT))
        XPutImage(theDisp, tmpPix, theGC, theImage, 0,0, 
  		((int) dispWIDE-eWIDE)/2, ((int) dispHIGH-eHIGH)/2, 
  		(u_int) eWIDE, (u_int) eHIGH);
