Pop-up now works when the window is in focus and death notification is send only when window is'nt in focus