Fix pointer capture on Android Q Beta 3

This commit is contained in:
Cameron Gutman 2019-05-16 21:26:38 -07:00
parent 99b53f9a6a
commit 393a4c9c8a

View File

@ -1382,10 +1382,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
connected = true;
connecting = false;
// Hide the mouse cursor now. Doing it before
// dismissing the spinner seems to be undone
// when the spinner gets displayed.
// Hide the mouse cursor now after a short delay.
// Doing it before dismissing the spinner seems to be undone
// when the spinner gets displayed. On Android Q, even now
// is too early to capture. We will delay a second to allow
// the spinner to dismiss before capturing.
Handler h = new Handler();
h.postDelayed(new Runnable() {
@Override
public void run() {
inputCaptureProvider.enableCapture();
}
}, 1000);
// Keep the display on
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);