[powerdebug V2: 12/14] make 'selectedwindow' variable static