enhance Qt grab window code for snap to work with Qt4