Fix mouse buttons not working in menus with alwaysgrabmouse on
This commit fixes #1257 by reintroducing something left out in commit
9f116c7c. From my testing, it looks
look the behavior is the exact same regarding the lua hook script that
the original commit was fixing (#879).