summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-07-11 18:59:28 -0400
committerGeenz <geenz@geenzo.com>2013-07-11 18:59:28 -0400
commit72bb473c9ed106cce6baf22ac74a13443d4630e8 (patch)
treee26976648a31a19ba3dd1e1c97cd2ddd03ff5537
parent6fbafaf056d61ab0ab49cc16a998a528f0ea22e8 (diff)
Ensure that the correct method is called when we're simulating a right click.
-rw-r--r--indra/llwindow/llopenglview-objc.h1
-rw-r--r--indra/llwindow/llopenglview-objc.mm9
2 files changed, 9 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h
index f895aae577..71149f8561 100644
--- a/indra/llwindow/llopenglview-objc.h
+++ b/indra/llwindow/llopenglview-objc.h
@@ -41,6 +41,7 @@
bool mHasMarkedText;
unsigned int mMarkedTextLength;
bool mMarkedTextAllowed;
+ bool mSimulatedRightClick;
}
- (id) initWithSamples:(NSUInteger)samples;
- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync;
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 77c2fc7e19..e5b7681435 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -246,6 +246,7 @@ attributedStringInfo getSegments(NSAttributedString *str)
if ([theEvent modifierFlags] & NSControlKeyMask)
{
callRightMouseDown(mMousePos, mModifiers);
+ mSimulatedRightClick = true;
} else {
if ([theEvent clickCount] >= 2)
{
@@ -258,7 +259,13 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void) mouseUp:(NSEvent *)theEvent
{
- callLeftMouseUp(mMousePos, mModifiers);
+ if (mSimulatedRightClick)
+ {
+ callRightMouseUp(mMousePos, mModifiers);
+ mSimulatedRightClick = false;
+ } else {
+ callLeftMouseUp(mMousePos, mModifiers);
+ }
}
- (void) rightMouseDown:(NSEvent *)theEvent