Qt::Popup is a mask, so we cannot use the `&` operator to test the window type. We need to use QFlags::testFlag() for that purpose instead. (cherry picked from commit 70700b86)