The window in Udupi is called "Kanakana kindi" or Kanaka's window. There are many legends as to how this exactly happened.
In one of the more famous accounts, the story goes as follows. Kanakadasa, an ardent devotee of Sri Krishna, was refused entry to the Udupi Krishna temple as he was from lower class. Saddened by this, Kanakadasa camped behind the temple and started composing songs praising Krishna. It was here where he composed one of his famous songs "Bagilanu teredu seveyanu kodu hari" (open the door and allow me to serve you). Krishna, moved by his devotion, turned 180˚, much to the astonishment of the priests. Soon cracks appeared on the wall and Kanakadasa could see the see the statue through them. It was this wall which later became the present day window, kanakana kindi. So, originally the idol of Krishna was facing east, the idol then turned west in order to face Kanakadasa.
This legend has been mentioned in A Prehistory of Hinduism by Manu V Devadevan. The book mentions that this act shows how a dasa utilizes his devotion to make his deity to perform miracles. The blog linked by YDS in the comments, also talks about this.
The Udupi Krishna Mutt website (not sure if it is official or not) mentions a similar account:
Kanakadasa, an ardent believer of God, came to Udupi to worship Lord Krishna. He was not allowed inside the temple since he was from a lower caste. Sri Krishna, pleased by the worship of Kanakadasa created a small hole in the back wall of the temple and turned to face the hole so that Kanakadasa could see him. This hole came to be known as KanakanaKindi.
Very recently, a The Hindu article mentioned that this story might be incorrect, citing the works of Hermann Freidrich Mogling, and that Shree Vadiraja might have led Kanakadasa directly into the temple. The wikipedia page that YDS mentions contains a similar story:
Kanaka Dâsa came to Udupi as a pilgrim. Sri Vâdirâja Tîrtha knew about this pious devotee of the Lord, and made arrangements for his stay in a hut in the roadside in front of the temple. Kanaka Dâsa used to play on his tambura and sing in the hut, but the wall of the temple was there between the icon and himself. Being of a lower class, by tradition he was forbidden to enter the temple and have darshana of Sri Krishna. The wall of the shrine was, of course, a barrier to the physical eyes, but who could prevent the vision of his inner eyes? They were fully open and the Sri Krishna was visible to Kanaka Dâsa. Some time passed and then one night there was an earthquake and a small crack appeared in the wall of the shrine. Through this crack Kanaka Dâsa was able to have darshana of the icon of Krishna. Sri Vâdirâja Tîrtha became aware of this crack and of the fact that Kanaka Dâsa was using it to have darshana of Sri Krishna. Instead of having the crack plastered over, Sri Vâdirâja enlarged it and turned it into a window. To commemorate Lord Krishna's darshana to Kanaka Dâsa, the window has been designated as 'Kanaka's window.'
However, given the fact that the Wikipedia page does not cite any reference, I would not be inclined to take it as a solid reference.
As an aside, the depiction of this scene and song can also be seen in the Kannada movie "Bhakta Kanakadasa")