(OSX) Don't register click if we are on titlebar (we detect this for now

if y of location in windows' position is less than 0
This commit is contained in:
Twinaphex 2016-10-01 02:01:01 +02:00
parent 5ff13df40f
commit f5a38977d8

View File

@ -148,20 +148,27 @@ static void app_terminate(void)
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
{
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
apple = (cocoa_input_data_t*)input_driver_get_data();
if (!apple)
if (!apple || pos.y < 0)
return;
apple->mouse_buttons |= 1 << event.buttonNumber;
apple->touch_count = 1;
apple->touch_count = 1;
}
break;
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp:
{
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
apple = (cocoa_input_data_t*)input_driver_get_data();
if (!apple)
if (!apple || pos.y < 0)
return;
apple->mouse_buttons &= ~(1 << event.buttonNumber);
apple->touch_count = 0;
}
break;
}
}