mirror of https://github.com/libsdl-org/SDL.git
cocoa: Only process hit tests on left clicks
Otherwise, right-click events over drag areas will be eaten.
This commit is contained in:
parent
dd0bdc2561
commit
c9d602307c
|
|
@ -1668,11 +1668,6 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||
}
|
||||
}
|
||||
|
||||
if ([self processHitTest:theEvent]) {
|
||||
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_HIT_TEST, 0, 0);
|
||||
return; // dragging, drop event.
|
||||
}
|
||||
|
||||
switch ([theEvent buttonNumber]) {
|
||||
case 0:
|
||||
if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
|
||||
|
|
@ -1695,6 +1690,11 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||
break;
|
||||
}
|
||||
|
||||
if (button == SDL_BUTTON_LEFT && [self processHitTest:theEvent]) {
|
||||
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_HIT_TEST, 0, 0);
|
||||
return; // dragging, drop event.
|
||||
}
|
||||
|
||||
Cocoa_SendMouseButtonClicks(mouse, theEvent, _data.window, button, true);
|
||||
}
|
||||
|
||||
|
|
@ -1721,11 +1721,6 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||
return;
|
||||
}
|
||||
|
||||
if ([self processHitTest:theEvent]) {
|
||||
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_HIT_TEST, 0, 0);
|
||||
return; // stopped dragging, drop event.
|
||||
}
|
||||
|
||||
switch ([theEvent buttonNumber]) {
|
||||
case 0:
|
||||
if (wasCtrlLeft) {
|
||||
|
|
@ -1746,6 +1741,11 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||
break;
|
||||
}
|
||||
|
||||
if (button == SDL_BUTTON_LEFT && [self processHitTest:theEvent]) {
|
||||
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_HIT_TEST, 0, 0);
|
||||
return; // stopped dragging, drop event.
|
||||
}
|
||||
|
||||
Cocoa_SendMouseButtonClicks(mouse, theEvent, _data.window, button, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue