From ec9a70de94a3123142de1a1765968185846a8e17 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 21 Mar 2019 18:58:11 +0200 Subject: SL-10648 Handling for Window crash on exit --- indra/llwindow/llwindowwin32.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') 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"), -- cgit v1.2.3 From 468fbd6b515cf321834e0056adde9b29e07ccffc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 25 Apr 2019 15:11:55 -0400 Subject: Return CGPoint and CGSize by value, not const ref to temporary. --- indra/llwindow/llwindowmacosx-objc.h | 6 +++--- indra/llwindow/llwindowmacosx-objc.mm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 34da99de19..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 c3eb9b8c8a..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; } -- cgit v1.2.3 From 19cae5d2ccbefee3741a80b8bc8e486dccf26873 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 8 Apr 2019 18:53:47 +0300 Subject: SL-10907 getWidthF32 crash in fonts --- indra/llwindow/llwindowwin32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 504c1589b0..20bf007b09 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4012,7 +4012,7 @@ void LLWindowWin32::setDPIAwareness() F32 LLWindowWin32::getSystemUISize() { - float scale_value = 0; + F32 scale_value = 1.f; HWND hWnd = (HWND)getPlatformWindow(); HDC hdc = GetDC(hWnd); HMONITOR hMonitor; -- cgit v1.2.3 From 77ba332880819112b49395f85eff7e575a12e3ec Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 16 May 2019 12:14:07 +0300 Subject: SL-11178 FIXED [mac] Viewer crashes if another app gets focus before viewer window is created --- indra/llwindow/llwindowmacosx.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') 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() -- cgit v1.2.3