diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 16 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 8 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 13 |
3 files changed, 34 insertions, 3 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 54a4793b2d..33eed7227a 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -343,6 +343,10 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) mouseDown:(NSEvent *)theEvent { + NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + // Apparently people still use this? if ([theEvent modifierFlags] & NSCommandKeyMask && !([theEvent modifierFlags] & NSControlKeyMask) && @@ -380,11 +384,17 @@ attributedStringInfo getSegments(NSAttributedString *str) - (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]); } - (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]); } @@ -431,11 +441,17 @@ attributedStringInfo getSegments(NSAttributedString *str) - (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]); } - (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]); } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index fedea3de08..6dec131a34 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -869,10 +869,11 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) size->mX = sz.width; size->mY = sz.height; + err = noErr; } 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); @@ -894,10 +895,13 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) size->mX = sz.width; size->mY = sz.height; + err = noErr; + + } 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); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 504c1589b0..a24f168ab1 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -738,6 +738,17 @@ void LLWindowWin32::restore() SetFocus(mWindowHandle); } +bool destroy_window_handler(HWND &hWnd) +{ + __try + { + return DestroyWindow(hWnd); + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + return false; + } +} // close() destroys all OS-specific code associated with a window. // Usually called from LLWindowManager::destroyWindow() @@ -811,7 +822,7 @@ void LLWindowWin32::close() ShowWindow(mWindowHandle, SW_HIDE); // This causes WM_DESTROY to be sent *immediately* - if (!DestroyWindow(mWindowHandle)) + if (!destroy_window_handler(mWindowHandle)) { OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"), mCallbacks->translateString("MBShutdownErr"), |