--- ray/src/hd/rhd_x11.c 2005/01/07 20:33:02 3.38 +++ ray/src/hd/rhd_x11.c 2006/06/07 17:52:04 3.42 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhd_x11.c,v 3.38 2005/01/07 20:33:02 greg Exp $"; +static const char RCSid[] = "$Id: rhd_x11.c,v 3.42 2006/06/07 17:52:04 schorsch Exp $"; #endif /* * X11 driver for holodeck display. @@ -190,8 +190,8 @@ dev_open( /* initialize X11 driver */ /* set window manager hints */ ourxwmhints.flags = InputHint|IconPixmapHint; ourxwmhints.input = True; - ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, - gwind, x11icon_bits, x11icon_width, x11icon_height); + ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, gwind, + (char *)x11icon_bits, x11icon_width, x11icon_height); XSetWMHints(ourdisplay, gwind, &ourxwmhints); oursizhints.min_width = MINWIDTH; oursizhints.min_height = MINHEIGHT; @@ -295,7 +295,8 @@ dev_view( /* assign new driver view */ extern void dev_section( /* add octree for geometry rendering */ - char *ofn + char *gfn, + char *pfn ) { /* unimplemented */ @@ -640,15 +641,23 @@ getframe( /* get focus frame */ ) { int startx = ebut->x, starty = ebut->y; - int endx, endy; - + int endx, endy, midx, midy; + FVECT v1; + int li; + /* get mouse drag */ XMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent)); endx = levptr(XButtonReleasedEvent)->x; endy = levptr(XButtonReleasedEvent)->y; - if ((endx == startx) | (endy == starty)) { - XBell(ourdisplay, 0); + midx = (startx + endx) >> 1; + midy = (starty + endy) >> 1; + /* set focus distance */ + if ((li = qtFindLeaf(midx, midy)) < 0) + return; /* not on window */ + VCOPY(v1, qtL.wp[li]); + odev.v.vdist = sqrt(dist2(odev.v.vp, v1)); + /* set frame for rendering */ + if ((endx == startx) | (endy == starty)) return; - } if (endx < startx) {register int c = endx; endx = startx; startx = c;} if (endy < starty) {register int c = endy; endy = starty; starty = c;} sprintf(odev_args, "%.3f %.3f %.3f %.3f",