mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r25658) -Fix [FS#4392]: [OSX] The mouse cursor would sometimes jump near the window borders. (Matthieu)
This commit is contained in:
parent
7ba4d425c8
commit
408c595eb8
@ -514,8 +514,21 @@ CGPoint WindowQuartzSubdriver::PrivateLocalToCG(NSPoint *p)
|
|||||||
|
|
||||||
NSPoint WindowQuartzSubdriver::GetMouseLocation(NSEvent *event)
|
NSPoint WindowQuartzSubdriver::GetMouseLocation(NSEvent *event)
|
||||||
{
|
{
|
||||||
NSPoint pt = [ event locationInWindow ];
|
NSPoint pt;
|
||||||
pt = [ this->cocoaview convertPoint:pt fromView:nil ];
|
|
||||||
|
if (event.window == nil) {
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||||
|
if ([ this->cocoaview respondsToSelector:@selector(convertRectFromScreen:) ]) {
|
||||||
|
pt = [ this->cocoaview convertPoint:[ [ this->cocoaview window ] convertRectFromScreen:NSMakeRect([ event locationInWindow ].x, [ event locationInWindow ].y, 0, 0) ].origin fromView:nil ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pt = [ this->cocoaview convertPoint:[ [ this->cocoaview window ] convertScreenToBase:[ event locationInWindow ] ] fromView:nil ];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pt = [ event locationInWindow ];
|
||||||
|
}
|
||||||
|
|
||||||
pt.y = this->window_height - pt.y;
|
pt.y = this->window_height - pt.y;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user