diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-11-02 09:54:52 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-02 09:54:52 -0800 |
commit | 9ed8b5299f2e5a8a912649e0e6aecaf89b034408 (patch) | |
tree | e7c9ecc91fbbef0c26fd352f2743ac050d8f889e /indra/newview/llviewerwindow.cpp | |
parent | 55731ee318e6e3c2e9998c6347cbd9d3635115c4 (diff) | |
parent | 3783852444825edf420e6109927df21fd004c3e7 (diff) |
Merge from remote repo
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3766e14eef..ea3c5c9de7 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2452,19 +2452,35 @@ void LLViewerWindow::updateUI() BOOL handled_by_top_ctrl = FALSE; LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); + LLView* captor_view = dynamic_cast<LLView*>(mouse_captor); + + //FIXME: only include captor and captor's ancestors if mouse is truly over them --RN //build set of views containing mouse cursor by traversing UI hierarchy and testing //screen rect against mouse cursor view_handle_set_t mouse_hover_set; - // start at current mouse captor (if is a view) or UI root - LLView* root_view = NULL; - root_view = dynamic_cast<LLView*>(mouse_captor); + // constraint mouse enter events to children of mouse captor + LLView* root_view = captor_view; + + // if mouse captor doesn't exist or isn't a LLView + // then allow mouse enter events on entire UI hierarchy if (!root_view) { root_view = mRootView; } + // include all ancestors of captor_view as automatically having mouse + if (captor_view) + { + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } + } + // aggregate visible views that contain mouse cursor in display order // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events |