diff -r 16d4081236af src/libdraw/init.c --- a/src/libdraw/init.c Wed Apr 27 13:18:07 2011 -0400 +++ b/src/libdraw/init.c Wed Nov 02 18:07:13 2011 +0100 @@ -145,7 +145,7 @@ } image->display = d; - image->id = 0; + image->id = atoi(info+1*12); image->chan = strtochan(info+2*12); image->depth = chantodepth(image->chan); image->repl = atoi(info+3*12); @@ -206,6 +206,12 @@ return nil; } disp->srvfd = -1; + /* + * The image id 1 is used by devdraw.9p to identify + * the image associated to winname. Since the counter + * is preincremented before use, 1 is a safe value. + */ + disp->imageid = 1; image = nil; if(0){ Error2: