summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-xindra/newview/llviewerwindow.cpp42
1 files changed, 40 insertions, 2 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f96c4b7bf0..50329d8576 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1037,7 +1037,16 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = TRUE;
+ mAllowMouseDragging = FALSE;
+ if (!mMouseDownTimer.getStarted())
+ {
+ mMouseDownTimer.start();
+ }
+ else
+ {
+ mMouseDownTimer.reset();
+ }
+ BOOL down = TRUE;
return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down);
}
@@ -1056,7 +1065,11 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = FALSE;
+ if (mMouseDownTimer.getStarted())
+ {
+ mMouseDownTimer.stop();
+ }
+ BOOL down = FALSE;
return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down);
}
@@ -1288,6 +1301,22 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
}
}
+void LLViewerWindow::handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK mask)
+{
+ if (mMouseDownTimer.getStarted())
+ {
+ if (mMouseDownTimer.getElapsedTimeF32() > 0.1)
+ {
+ mAllowMouseDragging = TRUE;
+ mMouseDownTimer.stop();
+ }
+ }
+ if(mAllowMouseDragging || !LLToolCamera::getInstance()->hasMouseCapture())
+ {
+ handleMouseMove(window, pos, mask);
+ }
+}
+
void LLViewerWindow::handleMouseLeave(LLWindow *window)
{
// Note: we won't get this if we have captured the mouse.
@@ -1617,6 +1646,8 @@ LLViewerWindow::LLViewerWindow(const Params& p)
mMiddleMouseDown(FALSE),
mRightMouseDown(FALSE),
mMouseInWindow( FALSE ),
+ mAllowMouseDragging(TRUE),
+ mMouseDownTimer(),
mLastMask( MASK_NONE ),
mToolStored( NULL ),
mHideCursorPermanent( FALSE ),
@@ -4951,6 +4982,13 @@ void LLViewerWindow::stopGL(BOOL save_state)
gGLManager.mIsDisabled = TRUE;
stop_glerror();
+
+ //unload shader's
+ while (LLGLSLShader::sInstances.size())
+ {
+ LLGLSLShader* shader = *(LLGLSLShader::sInstances.begin());
+ shader->unload();
+ }
LL_INFOS() << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory.value() << " bytes" << LL_ENDL;
}