Fix some warnings
Mac-specific: Fix some warnings while compile under MacOS
Mac-specific: Fix popup window calling without modifiers pressed
Mac-specific: Adjust code for Qt5 build