diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-01-08 04:51:50 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-01-08 04:51:50 +0000 |
commit | 91d92b85b573359c2ba6e99f5e0c3203e41431b5 (patch) | |
tree | fd3bec6eff026209937ecd1c7cfd42cf8899656d /guilib/GUIWindow.cpp | |
parent | 04f2f7f645644e7816b326833a7b2f0f2c5d82e6 (diff) |
cleanup: Changed the way controls are selected for focus under the mouse pointer. Fixes potential issues with control groups ignoring anything other than the first possibly focusable control when passing mouse actions.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26534 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIWindow.cpp')
-rw-r--r-- | guilib/GUIWindow.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index 9f84197c50..fb6830178b 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -397,21 +397,18 @@ bool CGUIWindow::OnMouseAction() CGUIControl *pControl = *i; pControl->UnfocusFromPoint(mousePoint); } - // and find which one is under the pointer - // go through in reverse order to make sure we start with the ones on top + // and find which ones are under the pointer + vector< pair<CGUIControl *, CPoint> > controls; + GetControlsFromPoint(mousePoint, controls); + bool controlUnderPointer(false); - for (vector<CGUIControl *>::reverse_iterator i = m_children.rbegin(); i != m_children.rend(); ++i) + for (vector< pair<CGUIControl *, CPoint> >::iterator i = controls.begin(); i != controls.end(); ++i) { - CGUIControl *pControl = *i; - CGUIControl *focusableControl = NULL; - CPoint controlPoint; - if (pControl->CanFocusFromPoint(mousePoint, &focusableControl, controlPoint)) - { - controlUnderPointer = focusableControl->OnMouseOver(controlPoint); - bHandled = HandleMouse(focusableControl, controlPoint); - if (bHandled || controlUnderPointer) - break; - } + CGUIControl *child = i->first; + controlUnderPointer = child->OnMouseOver(i->second); + bHandled = HandleMouse(child, i->second); + if (bHandled || controlUnderPointer) + break; } if (!bHandled) { // haven't handled this action - call the window message handlers |