bug #7354: arrow key scrolling, force the update to deal with different event priorities.

This commit is contained in:
beard%netscape.com 1999-05-31 01:45:23 +00:00
parent 18a5529ed4
commit 582c184279
2 changed files with 34 additions and 0 deletions

View File

@ -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;

View File

@ -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;