popup handling does not work unless application is in focus