SL-10888 Fixed OSX mouse issues in HiDPI mode
parent
6b2a1762e1
commit
db6d4a3cb4
|
|
@ -343,7 +343,7 @@ attributedStringInfo getSegments(NSAttributedString *str)
|
||||||
|
|
||||||
- (void) mouseDown:(NSEvent *)theEvent
|
- (void) mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
NSPoint mPoint = [theEvent locationInWindow];
|
NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow];
|
||||||
mMousePos[0] = mPoint.x;
|
mMousePos[0] = mPoint.x;
|
||||||
mMousePos[1] = mPoint.y;
|
mMousePos[1] = mPoint.y;
|
||||||
|
|
||||||
|
|
@ -384,11 +384,17 @@ attributedStringInfo getSegments(NSAttributedString *str)
|
||||||
|
|
||||||
- (void) rightMouseDown:(NSEvent *)theEvent
|
- (void) rightMouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow];
|
||||||
|
mMousePos[0] = mPoint.x;
|
||||||
|
mMousePos[1] = mPoint.y;
|
||||||
callRightMouseDown(mMousePos, [theEvent modifierFlags]);
|
callRightMouseDown(mMousePos, [theEvent modifierFlags]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) rightMouseUp:(NSEvent *)theEvent
|
- (void) rightMouseUp:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow];
|
||||||
|
mMousePos[0] = mPoint.x;
|
||||||
|
mMousePos[1] = mPoint.y;
|
||||||
callRightMouseUp(mMousePos, [theEvent modifierFlags]);
|
callRightMouseUp(mMousePos, [theEvent modifierFlags]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -435,11 +441,17 @@ attributedStringInfo getSegments(NSAttributedString *str)
|
||||||
|
|
||||||
- (void) otherMouseDown:(NSEvent *)theEvent
|
- (void) otherMouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow];
|
||||||
|
mMousePos[0] = mPoint.x;
|
||||||
|
mMousePos[1] = mPoint.y;
|
||||||
callMiddleMouseDown(mMousePos, [theEvent modifierFlags]);
|
callMiddleMouseDown(mMousePos, [theEvent modifierFlags]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) otherMouseUp:(NSEvent *)theEvent
|
- (void) otherMouseUp:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow];
|
||||||
|
mMousePos[0] = mPoint.x;
|
||||||
|
mMousePos[1] = mPoint.y;
|
||||||
callMiddleMouseUp(mMousePos, [theEvent modifierFlags]);
|
callMiddleMouseUp(mMousePos, [theEvent modifierFlags]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,9 +110,9 @@ void glSwapBuffers(void* context);
|
||||||
CGLContextObj getCGLContextObj(GLViewRef view);
|
CGLContextObj getCGLContextObj(GLViewRef view);
|
||||||
unsigned long getVramSize(GLViewRef view);
|
unsigned long getVramSize(GLViewRef view);
|
||||||
float getDeviceUnitSize(GLViewRef view);
|
float getDeviceUnitSize(GLViewRef view);
|
||||||
const CGPoint & getContentViewBoundsPosition(NSWindowRef window);
|
const CGPoint getContentViewBoundsPosition(NSWindowRef window);
|
||||||
const CGSize & getContentViewBoundsSize(NSWindowRef window);
|
const CGSize getContentViewBoundsSize(NSWindowRef window);
|
||||||
const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view);
|
const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view);
|
||||||
void getWindowSize(NSWindowRef window, float* size);
|
void getWindowSize(NSWindowRef window, float* size);
|
||||||
void setWindowSize(NSWindowRef window, int width, int height);
|
void setWindowSize(NSWindowRef window, int width, int height);
|
||||||
void getCursorPos(NSWindowRef window, float* pos);
|
void getCursorPos(NSWindowRef window, float* pos);
|
||||||
|
|
|
||||||
|
|
@ -258,17 +258,17 @@ float getDeviceUnitSize(GLViewRef view)
|
||||||
return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width;
|
return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGPoint & getContentViewBoundsPosition(NSWindowRef window)
|
const CGPoint getContentViewBoundsPosition(NSWindowRef window)
|
||||||
{
|
{
|
||||||
return [[(LLNSWindow*)window contentView] bounds].origin;
|
return [[(LLNSWindow*)window contentView] bounds].origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGSize & getContentViewBoundsSize(NSWindowRef window)
|
const CGSize getContentViewBoundsSize(NSWindowRef window)
|
||||||
{
|
{
|
||||||
return [[(LLNSWindow*)window contentView] bounds].size;
|
return [[(LLNSWindow*)window contentView] bounds].size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view)
|
const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view)
|
||||||
{
|
{
|
||||||
return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size;
|
return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -869,10 +869,11 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
|
||||||
|
|
||||||
size->mX = sz.width;
|
size->mX = sz.width;
|
||||||
size->mY = sz.height;
|
size->mY = sz.height;
|
||||||
|
err = noErr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
|
LL_ERRS() << "LLWindowMacOSX::getSize(): no window and not fullscreen!" << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (err == noErr);
|
return (err == noErr);
|
||||||
|
|
@ -894,10 +895,13 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)
|
||||||
|
|
||||||
size->mX = sz.width;
|
size->mX = sz.width;
|
||||||
size->mY = sz.height;
|
size->mY = sz.height;
|
||||||
|
err = noErr;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
|
LL_ERRS() << "LLWindowMacOSX::getSize(): no window and not fullscreen!" << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (err == noErr);
|
return (err == noErr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue