anchor.diff:    Result := actualtype <> None;
   end;
   
  +{ find toplevel window that contains mouse co-ordinates x, y (co-ordinates are
  +  from root window) }
   function FindWindow(ARoot: TWindow; const x, y: cint): TWindow;
   var
     wattr: TXWindowAttributes;
     r, p: TWindow;
     children: PWindowArray = nil;
  -  numch: cuint = 0;
  +  numchildren: cuint = 0;
     i: integer;
   begin
  -//  writeln('FindWindow ');
     XGetWindowAttributes(xapplication.Display, ARoot, @wattr);
     if (wattr.map_state <> IsUnmapped) and
         ((x >= wattr.x) and (x < (wattr.x + wattr.width))) and
  
positive.code:       Result := ARoot;
        exit;
      end;
  //     writeln('Query Tree');
      if XQueryTree(xapplication.Display, ARoot, @r, @p, @children, @numch) <> 0 then
      begin
        if (numch > 0) and (children <> nil) then
        begin
          r := None;
          { upon return from XQueryTree, children are listed in the current
            stacking order, from bottom-most (first) to top-most (last) }
          for i := numch-1 downto 0 do
          begin
            r := FindWindow(children^[i], x - wattr.x, y - wattr.y);
            if r <> None then
  
negative.code:   count, remaining: culong;
    data: pchar = nil;
  begin
    XGetWindowProperty(xapplication.Display, AWin, xapplication.xia_wm_state, 0, 0,
        TBool(False), AnyPropertyType, @actualtype, @actualformat, @count,
        @remaining, @data);
  