Fix grab issue when destroying open popup menu
The fix is in the first commit, the second one fixes some related (but harmless) warnings.
Fixes #3022 (closed)
The fix is in the first commit, the second one fixes some related (but harmless) warnings.
Fixes #3022 (closed)