mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 23:06:03 +00:00
cocoa: Only process hit tests on left clicks
Otherwise, right-click events over drag areas will be eaten.
This commit is contained in:
@@ -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]) {
|
switch ([theEvent buttonNumber]) {
|
||||||
case 0:
|
case 0:
|
||||||
if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
|
if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
|
||||||
@@ -1695,6 +1690,11 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||||||
break;
|
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);
|
Cocoa_SendMouseButtonClicks(mouse, theEvent, _data.window, button, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1721,11 +1721,6 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([self processHitTest:theEvent]) {
|
|
||||||
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_HIT_TEST, 0, 0);
|
|
||||||
return; // stopped dragging, drop event.
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ([theEvent buttonNumber]) {
|
switch ([theEvent buttonNumber]) {
|
||||||
case 0:
|
case 0:
|
||||||
if (wasCtrlLeft) {
|
if (wasCtrlLeft) {
|
||||||
@@ -1746,6 +1741,11 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|||||||
break;
|
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);
|
Cocoa_SendMouseButtonClicks(mouse, theEvent, _data.window, button, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user