summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-05-18 14:08:24 -0400
committerNat Goodspeed <nat@lindenlab.com>2022-05-18 14:08:24 -0400
commitc0aa1a1202678fdde0206c9372fb071c028cfe5b (patch)
tree614a5e0b9e24343c59709a9378050b601dd0f828 /indra/llwindow
parent06aa68c2fbcd83cb00465c9f14933bda276b11e8 (diff)
parenta9363222618a879dd7d0d78471f8773af6b61618 (diff)
SL-17219: Merge 'DRTVWR-546' of lindenlab/viewer into SL-17219
Update task branch from main project branch.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowwin32.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e38c43bc63..da79660239 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -932,6 +932,10 @@ void LLWindowWin32::close()
}
});
+ // Window thread might be waiting for a getMessage(), give it
+ // a push to enshure it will process destroy_window_handler
+ kickWindowThread();
+
// Even though the above lambda might not yet have run, we've already
// bound mWindowHandle into it by value, which should suffice for the
// operations we're asking. That's the last time WE should touch it.
@@ -1276,9 +1280,9 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BO
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
&pfd))
{
- close();
OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1315,42 +1319,42 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BO
if (pfd.cColorBits < 32)
{
- close();
OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (pfd.cAlphaBits < 8)
{
- close();
OSMessageBox(mCallbacks->translateString("MBAlpha"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (!SetPixelFormat(mhDC, pixel_format, &pfd))
{
- close();
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (!(mhRC = SafeCreateContext(mhDC)))
{
- close();
OSMessageBox(mCallbacks->translateString("MBGLContextErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (!wglMakeCurrent(mhDC, mhRC))
{
- close();
OSMessageBox(mCallbacks->translateString("MBGLContextActErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1557,16 +1561,16 @@ const S32 max_format = (S32)num_formats - 1;
if (!mhDC)
{
- close();
OSMessageBox(mCallbacks->translateString("MBDevContextErr"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (!SetPixelFormat(mhDC, pixel_format, &pfd))
{
- close();
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1602,8 +1606,8 @@ const S32 max_format = (S32)num_formats - 1;
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
&pfd))
{
- close();
OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1615,15 +1619,15 @@ const S32 max_format = (S32)num_formats - 1;
// make sure we have 32 bits per pixel
if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32)
{
- close();
OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
if (pfd.cAlphaBits < 8)
{
- close();
OSMessageBox(mCallbacks->translateString("MBAlpha"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1639,8 +1643,8 @@ const S32 max_format = (S32)num_formats - 1;
if (!wglMakeCurrent(mhDC, mhRC))
{
- close();
OSMessageBox(mCallbacks->translateString("MBGLContextActErr"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -1648,8 +1652,8 @@ const S32 max_format = (S32)num_formats - 1;
if (!gGLManager.initGL())
{
- close();
OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK);
+ close();
return FALSE;
}
@@ -4394,7 +4398,8 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM request, LPARAM param, LRESULT *res
S32 context_offset;
LLWString context = find_context(wtext, preedit, preedit_length, &context_offset);
preedit -= context_offset;
- if (preedit_length)
+ preedit_length = llmin(preedit_length, (S32)context.length() - preedit);
+ if (preedit_length && preedit >= 0)
{
// IMR_DOCUMENTFEED may be called when we have an active preedit.
// We should pass the context string *excluding* the preedit string.