Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79c14862 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Do not show mouse cursor on displays that are off

Bug: 228085350
Test: manual: cursor shows on foldable with mouse connected
Change-Id: Id64ba2239781c6b9790b2380753869d83fc8f008
parent 23b8a6d6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.graphics.PointF;
import android.os.Debug;
import android.os.IBinder;
import android.util.Slog;
import android.view.Display;
import android.view.InputApplicationHandle;
import android.view.KeyEvent;
import android.view.SurfaceControl;
@@ -194,6 +195,9 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal
            int firstExternalDisplayId = DEFAULT_DISPLAY;
            for (int i = mService.mRoot.mChildren.size() - 1; i >= 0; --i) {
                final DisplayContent displayContent = mService.mRoot.mChildren.get(i);
                if (displayContent.getDisplayInfo().state == Display.STATE_OFF) {
                    continue;
                }
                // Heuristic solution here. Currently when "Freeform windows" developer option is
                // enabled we automatically put secondary displays in freeform mode and emulating
                // "desktop mode". It also makes sense to show the pointer on the same display.