static SegmovfeatState *states_head;
static Display *d;
static oop_source_sys *sys_events;
-static Window w=None;
+static Window w;
static int redraw_needed_count, expose_count;
static Pixmap bg_pixmap;
static unsigned long train_pixel, owned_pixel;
XpmAttributes mattribs;
XWindowAttributes wattribs;
int segment_ix, movfeat_ix, posn, invert, det, oor, infd;
+ Window wspec=None;
XGCValues gcv;
XColor colour;
SegmovfeatState *fs;
} else if (arg[0]=='-') {
die("invalid option(s)");
} else {
- errno=0; w= strtoul(arg,&ep,0);
- if (errno || ep==arg || *ep || w==None) die("bad windowid");
+ errno=0; wspec= strtoul(arg,&ep,0);
+ if (errno || ep==arg || *ep || wspec==None) die("bad windowid");
}
}
d= XOpenDisplay(0); if (!d) die("XOpenDisplay failed");
- if (w==None) {
+ if (wspec==None) {
w= XCreateSimpleWindow(d, DefaultRootWindow(d),
0,0, ui_plan_data.xsz, ui_plan_data.ysz,
0,0, 0);
if (w == None) diex("XCreateSimpleWindow", "initial");
+ } else {
+ w= wspec;
}
XCALL( XGetWindowAttributes, 0, (d,w,&wattribs) );
XCALL( XSelectInput, 0, (d,w, ExposureMask) );
- if (arg) {
+ if (wspec!=None) {
XCALL( XClearArea, "initial", (d,w, 0,0,0,0, True) );
} else {
XCALL( XMapWindow, 0, (d,w) );