зеркало из https://github.com/mozilla/gecko-dev.git
Move focus shifting code from nsScrollingView.cpp to nsEventStateManager.cpp
This commit is contained in:
Родитель
9b32717dad
Коммит
d798c3e079
|
@ -113,6 +113,10 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
||||||
|
if (nsnull != aEvent->widget) {
|
||||||
|
aEvent->widget->SetFocus();
|
||||||
|
}
|
||||||
|
//Break left out on purpose
|
||||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||||
|
@ -126,6 +130,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||||
ShiftFocus();
|
ShiftFocus();
|
||||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
break;
|
break;
|
||||||
|
case NS_VK_PAGE_DOWN:
|
||||||
|
case NS_VK_PAGE_UP:
|
||||||
|
break;
|
||||||
|
case NS_VK_DOWN:
|
||||||
|
case NS_VK_UP:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -113,6 +113,10 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
||||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
||||||
|
if (nsnull != aEvent->widget) {
|
||||||
|
aEvent->widget->SetFocus();
|
||||||
|
}
|
||||||
|
//Break left out on purpose
|
||||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||||
|
@ -126,6 +130,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||||
ShiftFocus();
|
ShiftFocus();
|
||||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
break;
|
break;
|
||||||
|
case NS_VK_PAGE_DOWN:
|
||||||
|
case NS_VK_PAGE_UP:
|
||||||
|
break;
|
||||||
|
case NS_VK_DOWN:
|
||||||
|
case NS_VK_UP:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -662,17 +662,6 @@ NS_IMETHODIMP nsScrollingView :: HandleEvent(nsGUIEvent *aEvent, PRUint32 aEvent
|
||||||
|
|
||||||
switch (aEvent->message)
|
switch (aEvent->message)
|
||||||
{
|
{
|
||||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
|
||||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
|
||||||
GetWidget(win);
|
|
||||||
if (nsnull != win)
|
|
||||||
{
|
|
||||||
win->SetFocus();
|
|
||||||
NS_RELEASE(win);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NS_KEY_DOWN:
|
case NS_KEY_DOWN:
|
||||||
{
|
{
|
||||||
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче