Path: utzoo!utgpu!attcan!uunet!wuarchive!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!MS.WASHINGTON.EDU!bill
From: bill@MS.WASHINGTON.EDU (Bill Dunlap)
Newsgroups: comp.windows.x
Subject: X Window System Bug Report
Message-ID: <8909301922.AA16307@entropy.ms.washington.edu>
Date: 30 Sep 89 19:22:22 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 164
X Window System Bug Report
xbugs@expo.lcs.mit.edu
VERSION:
R3beta (as well as R2).
CLIENT MACHINE and OPERATING SYSTEM:
IBM PC/RT running AOS 4.3 (Dec 88 release) with the hc release 2.1n
C compiler from Metaware (which comes with AOS).
DISPLAY:
IBM APA16
WINDOW MANAGER:
any or none.
AREA:
server
SYNOPSIS:
Server dies with floating point exception or goes into infinite
loop when it tries to clip a vertical dashed line.
DESCRIPTION:
[no detailed description]
REPEAT BY:
Compile the following program (up to END-OF-PROGRAM) with
-lX11 and run with no arguments. If you give it one integer argument,
that will be taken as an index into dash_lists[]. The argument 0 gives
a solid line -- that gives no problems. The problems seems to depend
on the exact placement and border width of the window.
START-OF-PROGRAM
#include
#include
static char *dash_lists[] = {
"\004", /* solid cannot be represented with dash list */
"\002\004", /* dotted */
"\004\003\002\003", /* dash-dotted */
"\010\003", /* longdashed */
"\002\002\004\002\002\002\002\002", /* dot-dash-dot-dot */
"\002\002\010\002", /* dot-longdash */
"\002\002\002\002\002\005", /* dot-dot-dot-longspace */
"\004\004", /* shortdashed */
} ;
#define NLTYS (sizeof(dash_lists)/sizeof(dash_lists[0]))
int ilty ;
main(argc, argv)
int argc ;
char *argv[] ;
{
Display *dpy ;
Screen *scr ;
Window plot_window ;
Window obscuring_window ;
XSetWindowAttributes xswa ;
XEvent xev ;
GC gc ;
int i ;
if (!(dpy= XOpenDisplay((char *)NULL))) {
perror("Cannot open display");
exit(-1);
}
(void)XSynchronize(dpy, 1) ; /* synchronize for debugging */
scr = DefaultScreenOfDisplay(dpy) ;
xswa.event_mask = ExposureMask ;
xswa.background_pixel = BlackPixelOfScreen(scr);
xswa.border_pixel = WhitePixelOfScreen(scr);
xswa.override_redirect = True ; /* elude window manager */
plot_window = XCreateWindow(dpy, RootWindowOfScreen(scr),
400, 400, /* position */
100, 128, /* size */
2, /* border width */
DefaultDepthOfScreen(scr), InputOutput,
DefaultVisualOfScreen(scr),
CWEventMask | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
&xswa) ;
xswa.event_mask = 0L ;
obscuring_window = XCreateWindow(dpy, RootWindowOfScreen(scr),
375, 432, /* position */
150, 32, /* size */
2, /* border width */
DefaultDepthOfScreen(scr), InputOutput,
DefaultVisualOfScreen(scr),
CWEventMask | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
&xswa) ;
gc = XCreateGC(dpy, plot_window, 0L, (XGCValues *)0) ;
XSetForeground(dpy, gc, WhitePixelOfScreen(scr));
ilty = argc>1 ? atoi(argv[1]) : 1 ;
ilty = ilty % NLTYS ;
if (ilty != 0) {
XSetDashes(dpy, gc, 0, dash_lists[ilty], strlen(dash_lists[ilty])) ;
XSetLineAttributes(dpy, gc,
(unsigned int)0, /* width */
LineOnOffDash, CapButt, JoinMiter) ;
} else {
XSetLineAttributes(dpy, gc,
(unsigned int)0, /* width */
LineSolid, CapButt, JoinMiter) ;
}
(void)fprintf(stderr, "ilty = %d, dash pattern is", ilty) ;
for(i=0 ; inewLine)
{
+ #define BILL_FIX
+ #ifndef BILL_FIX /* hc 2.1n is confused by the next line */
pt1Orig = pt1 = *pptInit++;
+ #else
+ pt1 = *pptInit;
+ pt1Orig = pt1 ;
+ pptInit++;
+ #endif
pt2 = *pptInit;
adx = pt2.x - pt1.x;
ady = pt2.y - pt1.y;
Bill Dunlap
Dept of Statistics, GN-22
University of Washington
Seattle, WA 98195
bill@stat.washington.edu