summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowmacosx-objc.h6
-rw-r--r--indra/llwindow/llwindowmacosx-objc.mm6
-rw-r--r--indra/llwindow/llwindowmacosx.cpp5
-rw-r--r--indra/llwindow/llwindowwin32.cpp13
4 files changed, 22 insertions, 8 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index 10bd3cbb91..99af161102 100644
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -110,9 +110,9 @@ void glSwapBuffers(void* context);
CGLContextObj getCGLContextObj(GLViewRef view);
unsigned long getVramSize(GLViewRef view);
float getDeviceUnitSize(GLViewRef view);
-const CGPoint getContentViewBoundsPosition(NSWindowRef window);
-const CGSize getContentViewBoundsSize(NSWindowRef window);
-const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view);
+CGPoint getContentViewBoundsPosition(NSWindowRef window);
+CGSize getContentViewBoundsSize(NSWindowRef window);
+CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view);
void getWindowSize(NSWindowRef window, float* size);
void setWindowSize(NSWindowRef window, int width, int height);
void getCursorPos(NSWindowRef window, float* pos);
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm
index 8fece7c5c7..f895c17643 100644
--- a/indra/llwindow/llwindowmacosx-objc.mm
+++ b/indra/llwindow/llwindowmacosx-objc.mm
@@ -258,17 +258,17 @@ float getDeviceUnitSize(GLViewRef view)
return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width;
}
-const CGPoint getContentViewBoundsPosition(NSWindowRef window)
+CGPoint getContentViewBoundsPosition(NSWindowRef window)
{
return [[(LLNSWindow*)window contentView] bounds].origin;
}
-const CGSize getContentViewBoundsSize(NSWindowRef window)
+CGSize getContentViewBoundsSize(NSWindowRef window)
{
return [[(LLNSWindow*)window contentView] bounds].size;
}
-const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view)
+CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view)
{
return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size;
}
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 6dec131a34..3554f90be8 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -382,7 +382,10 @@ void callWindowFocus()
void callWindowUnfocus()
{
- gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);
+ if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+ {
+ gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);
+ }
}
void callWindowHide()
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 985bd79d13..e05f507506 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -741,6 +741,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()
@@ -814,7 +825,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"),