summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2020-01-06 20:28:37 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2020-01-06 20:28:37 +0200
commit2076f4af0fc946c3bd79754a1deefc495ee7edb9 (patch)
tree859f1a0a7a82a571dde9a26c738e59a862cd6c05 /indra/llwindow/llwindowwin32.cpp
parent4c006e76e39a8b59dc6f9c890e5a27d38b5ece50 (diff)
parentd656d49a77eeb65ae537c954ea4009bc22da7b2b (diff)
Merged in viewer-release
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e05f507506..8fefb119bc 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2539,6 +2539,72 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
}
}
break;
+ case WM_XBUTTONDOWN:
+ {
+ window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONDOWN");
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
+ S32 button = GET_XBUTTON_WPARAM(w_param);
+ if (LLWinImm::isAvailable() && window_imp->mPreeditor)
+ {
+ window_imp->interruptLanguageTextInput();
+ }
+
+ // Because we move the cursor position in tllviewerhe 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
+ // first click changes the cursor position, all subsequent clicks
+ // will occur at the wrong location. JC
+ if (window_imp->mMousePositionModified)
+ {
+ LLCoordWindow cursor_coord_window;
+ window_imp->getCursorPosition(&cursor_coord_window);
+ gl_coord = cursor_coord_window.convert();
+ }
+ else
+ {
+ gl_coord = window_coord.convert();
+ }
+ MASK mask = gKeyboard->currentMask(TRUE);
+ // generate move event to update mouse coordinates
+ window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask);
+ // Windows uses numbers 1 and 2 for buttons, remap to 4, 5
+ if (window_imp->mCallbacks->handleOtherMouseDown(window_imp, gl_coord, mask, button + 3))
+ {
+ return 0;
+ }
+ }
+ break;
+
+ case WM_XBUTTONUP:
+ {
+ window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
+ S32 button = GET_XBUTTON_WPARAM(w_param);
+ // Because we move the cursor position in the llviewer 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
+ // first click changes the cursor position, all subsequent clicks
+ // will occur at the wrong location. JC
+ if (window_imp->mMousePositionModified)
+ {
+ LLCoordWindow cursor_coord_window;
+ window_imp->getCursorPosition(&cursor_coord_window);
+ gl_coord = cursor_coord_window.convert();
+ }
+ else
+ {
+ gl_coord = window_coord.convert();
+ }
+ MASK mask = gKeyboard->currentMask(TRUE);
+ // generate move event to update mouse coordinates
+ window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask);
+ // Windows uses numbers 1 and 2 for buttons, remap to 4, 5
+ if (window_imp->mCallbacks->handleOtherMouseUp(window_imp, gl_coord, mask, button + 3))
+ {
+ return 0;
+ }
+ }
+ break;
case WM_MOUSEWHEEL:
{