Bug 1713023 - Ensure we always call ExitUserInputProcessing. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D116053
This commit is contained in:
Matt Woodrow 2021-05-28 21:23:54 +00:00
parent 7b47184b2c
commit b126d382e1

View File

@ -1023,6 +1023,11 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,
refreshDriver->EnterUserInputProcessing();
}
}
auto cleanup = MakeScopeExit([&] {
if (refreshDriver) {
refreshDriver->ExitUserInputProcessing();
}
});
clearTargets = ShouldClearTargets(aEvent);
@ -1138,10 +1143,6 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,
break;
}
}
if (refreshDriver) {
driver->ExitUserInputProcessing();
}
}
preVisitor.mEventStatus = postVisitor.mEventStatus;