improve popup handling (fixes issue #2435)
improve popup handling (fixes issue #2435)

SamMousa/thebuggenie,praveenscience/thebuggenie,deshion/thebuggenie,Rvanlaak/thebuggenie,Rvanlaak/thebuggenie,hurie/thebuggenie,dachaac/thebuggenie,gabor-udvari/thebuggenie,azaghal/thebuggenie,SysBind/thebuggenie,gabor-udvari/thebuggenie,thebuggenie/thebuggenie,nrensen/thebuggenie,Rvanlaak/thebuggenie,thebuggenie/thebuggenie,gabor-udvari/thebuggenie,milkyway-git/thebuggenie,dachaac/thebuggenie,hurie/thebuggenie,stolenbike/thebuggenie,SamMousa/thebuggenie,JonathanRH/thebuggenie,thebuggenie/thebuggenie,deshion/thebuggenie,nrensen/thebuggenie,SamMousa/thebuggenie,deshion/thebuggenie,JonathanRH/thebuggenie,stolenbike/thebuggenie,Rvanlaak/thebuggenie,SysBind/thebuggenie,LogosLabs/thebuggenie,dachaac/thebuggenie,stolenbike/thebuggenie,hurie/thebuggenie,LogosLabs/thebuggenie,SamMousa/thebuggenie,azaghal/thebuggenie,hurie/thebuggenie,azaghal/thebuggenie,praveenscience/thebuggenie,SysBind/thebuggenie,milkyway-git/thebuggenie,LogosLabs/thebuggenie,stolenbike/thebuggenie,milkyway-git/thebuggenie,gabor-udvari/thebuggenie,praveenscience/thebuggenie,deshion/thebuggenie,dachaac/thebuggenie,JonathanRH/thebuggenie,nrensen/thebuggenie,praveenscience/thebuggenie,SysBind/thebuggenie,LogosLabs/thebuggenie,JonathanRH/thebuggenie,thebuggenie/thebuggenie,thebuggenie/thebuggenie,milkyway-git/thebuggenie,nrensen/thebuggenie,azaghal/thebuggenie