simplify window tracking
fixes issue #20: patch for bug 645371 needs to be applied to all windows