Load correct resources for pointer icon on external screen
When mouse pointer changes displays, it should also reload the icon from new resources. Otherwise, if the densities of the previous and new displays are different, the size of the pointer sprite will look too small or too large. - Add getDisplayContext to get the corresponding Context by displayId. - Cache system pointer icons per display, clear if display removed. - Fix icon moved to default when not resetting out of task bound. Bug: 113559891 Test: Enable mouse pointer on default display, move to other screen Change-Id: Ic42d0ec32d9c979281e13c83b9e8b57134fd4f0d
This commit is contained in:
committed by
Arthur Hung
parent
a67e674c22
commit
fd8666df52
@@ -255,7 +255,7 @@ void PointerController::setPresentation(Presentation presentation) {
|
||||
|
||||
if (presentation == PRESENTATION_POINTER && mLocked.additionalMouseResources.empty()) {
|
||||
mPolicy->loadAdditionalMouseResources(&mLocked.additionalMouseResources,
|
||||
&mLocked.animationResources);
|
||||
&mLocked.animationResources, mLocked.viewport.displayId);
|
||||
}
|
||||
|
||||
if (mLocked.presentation != presentation) {
|
||||
@@ -727,14 +727,14 @@ void PointerController::fadeOutAndReleaseAllSpotsLocked() {
|
||||
}
|
||||
|
||||
void PointerController::loadResourcesLocked() REQUIRES(mLock) {
|
||||
mPolicy->loadPointerResources(&mResources);
|
||||
mPolicy->loadPointerResources(&mResources, mLocked.viewport.displayId);
|
||||
|
||||
if (mLocked.presentation == PRESENTATION_POINTER) {
|
||||
mLocked.additionalMouseResources.clear();
|
||||
mLocked.animationResources.clear();
|
||||
mPolicy->loadPointerIcon(&mLocked.pointerIcon);
|
||||
mPolicy->loadPointerIcon(&mLocked.pointerIcon, mLocked.viewport.displayId);
|
||||
mPolicy->loadAdditionalMouseResources(&mLocked.additionalMouseResources,
|
||||
&mLocked.animationResources);
|
||||
&mLocked.animationResources, mLocked.viewport.displayId);
|
||||
}
|
||||
|
||||
mLocked.pointerIconChanged = true;
|
||||
|
||||
Reference in New Issue
Block a user