mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #10611 from AlexKornitzer/master
cocoa: disable clipping cursor to window
This commit is contained in:
commit
57cd3fdf06
@ -201,16 +201,12 @@ static int16_t cocoa_mouse_state(cocoa_input_data_t *apple,
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_MOUSE_X:
|
||||
val = apple->mouse_rel_x;
|
||||
// NOTE: Because cocoa events are effectively handled async we reset
|
||||
// the delta which we cumulate on each event
|
||||
apple->mouse_rel_x = 0;
|
||||
val = apple->window_pos_x - apple->mouse_x_last;
|
||||
apple->mouse_x_last = apple->window_pos_x;
|
||||
return val;
|
||||
case RETRO_DEVICE_ID_MOUSE_Y:
|
||||
val = apple->mouse_rel_y;
|
||||
// NOTE: Because cocoa events are effectively handled async we reset
|
||||
// the delta which we cumulate on each event
|
||||
apple->mouse_rel_y = 0;
|
||||
val = apple->window_pos_y - apple->mouse_y_last;
|
||||
apple->mouse_y_last = apple->window_pos_y;
|
||||
return val;
|
||||
case RETRO_DEVICE_ID_MOUSE_LEFT:
|
||||
return apple->mouse_buttons & 1;
|
||||
|
@ -137,10 +137,11 @@ static void app_terminate(void)
|
||||
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;
|
||||
}
|
||||
// FIXME: Disable clipping until graphical offset issues are fixed
|
||||
//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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user