summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreylproductengine <andreylproductengine@lindenlab.com>2014-03-11 19:22:11 +0200
committerandreylproductengine <andreylproductengine@lindenlab.com>2014-03-11 19:22:11 +0200
commit2ae011dc5ce8b2112c65757ac85e0567165975cf (patch)
treeda3a092f16bffb441b96517c09687af529772bfa /indra
parent504509c2882b098997ff4ab2648cc555c2314c2f (diff)
MAINT-3786 FIXED When bringing focus back to the viewer with a single click
in world view, a double click teleport to clicked point happens under certain circumstances
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llwindow/llwindowwin32.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 30f5526500..e45a511e6d 100755
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1831,6 +1831,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
static bool sHandleLeftMouseUp = true;
+ // Ignore the double click received right after activating app.
+ // This is to avoid triggering double click teleport after returning focus (see MAINT-3786).
+ static bool sHandleDoubleClick = true;
+
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
@@ -1958,6 +1962,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
}
}
+ if (!activating)
+ {
+ sHandleDoubleClick = false;
+ }
+
window_imp->mCallbacks->handleActivateApp(window_imp, activating);
break;
@@ -2182,6 +2191,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_NCLBUTTONDOWN");
// A click in a non-client area, e.g. title bar or window border.
sHandleLeftMouseUp = false;
+ sHandleDoubleClick = true;
}
break;
@@ -2226,6 +2236,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
//case WM_RBUTTONDBLCLK:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDBLCLK");
+
+ if (!sHandleDoubleClick)
+ {
+ sHandleDoubleClick = true;
+ break;
+ }
+
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the