mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
cocoa: don't update mouse events when outside nswindow
This commit is contained in:
parent
edfafd9fad
commit
c4ee0463aa
@ -131,26 +131,26 @@ static void app_terminate(void)
|
||||
pos.x = 0;
|
||||
pos.y = 0;
|
||||
|
||||
/* Relative */
|
||||
apple->mouse_rel_x += (int16_t)event.deltaX;
|
||||
apple->mouse_rel_y += (int16_t)event.deltaY;
|
||||
|
||||
/* Absolute */
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
|
||||
#elif defined(HAVE_COCOA)
|
||||
pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||
#endif
|
||||
|
||||
NSInteger window_number = [[[NSApplication sharedApplication] keyWindow] windowNumber];
|
||||
if ([NSWindow windowNumberAtPoint:pos belowWindowWithWindowNumber:0] != window_number) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Relative */
|
||||
apple->mouse_rel_x += (int16_t)event.deltaX;
|
||||
apple->mouse_rel_y += (int16_t)event.deltaY;
|
||||
|
||||
/* Absolute */
|
||||
apple->touches[0].screen_x = (int16_t)pos.x;
|
||||
apple->touches[0].screen_y = (int16_t)pos.y;
|
||||
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
mouse_pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
|
||||
#elif defined(HAVE_COCOA)
|
||||
mouse_pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||
#endif
|
||||
apple->window_pos_x = (int16_t)mouse_pos.x;
|
||||
apple->window_pos_y = (int16_t)mouse_pos.y;
|
||||
apple->window_pos_x = (int16_t)pos.x;
|
||||
apple->window_pos_y = (int16_t)pos.y;
|
||||
}
|
||||
break;
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user