// needed, see http://people.apache.org/~tvolkert/tests/scrolling/.
// There seems to be no workaround, so we have to turn the optimization
// completely off if we're not sure that we're unobscured.
if (optimizeScrolling) {
ApplicationContext.DisplayHost displayHost = viewport.getDisplay().getDisplayHost();
ApplicationContext applicationContext = displayHost.getApplicationContext();
optimizeScrolling = (applicationContext instanceof DesktopApplicationContext ||
(displayHost.getPeer().canDetermineObscurity() && !displayHost.getPeer().isObscured()));
}