fix bug on mac in handling mouse events, we were not getting the motion events. Needs testing on linux.