mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
bug #7354: arrow key scrolling, force the update to deal with different event priorities.
This commit is contained in:
parent
18a5529ed4
commit
582c184279
@ -208,6 +208,23 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
if (sv) {
|
||||
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
||||
sv->ScrollByLines((keyEvent->keyCode == NS_VK_DOWN) ? 1 : -1);
|
||||
|
||||
// force the update to happen now, otherwise multiple scrolls can
|
||||
// occur before the update is processed. (bug #7354)
|
||||
nsIViewManager* vm = nsnull;
|
||||
if (NS_OK == aView->GetViewManager(vm) && nsnull != vm) {
|
||||
// I'd use Composite here, but it doesn't always work.
|
||||
// vm->Composite();
|
||||
nsIView* rootView = nsnull;
|
||||
if (NS_OK == vm->GetRootView(rootView) && nsnull != rootView) {
|
||||
nsIWidget* rootWidget = nsnull;
|
||||
if (NS_OK == rootView->GetWidget(rootWidget) && nsnull != rootWidget) {
|
||||
rootWidget->Update();
|
||||
NS_RELEASE(rootWidget);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -208,6 +208,23 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
|
||||
if (sv) {
|
||||
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;
|
||||
sv->ScrollByLines((keyEvent->keyCode == NS_VK_DOWN) ? 1 : -1);
|
||||
|
||||
// force the update to happen now, otherwise multiple scrolls can
|
||||
// occur before the update is processed. (bug #7354)
|
||||
nsIViewManager* vm = nsnull;
|
||||
if (NS_OK == aView->GetViewManager(vm) && nsnull != vm) {
|
||||
// I'd use Composite here, but it doesn't always work.
|
||||
// vm->Composite();
|
||||
nsIView* rootView = nsnull;
|
||||
if (NS_OK == vm->GetRootView(rootView) && nsnull != rootView) {
|
||||
nsIWidget* rootWidget = nsnull;
|
||||
if (NS_OK == rootView->GetWidget(rootWidget) && nsnull != rootWidget) {
|
||||
rootWidget->Update();
|
||||
NS_RELEASE(rootWidget);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user