mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-05 23:46:04 +00:00
Final fixes for Android O pointer capture
This commit is contained in:
@@ -32,7 +32,7 @@ public class AndroidNativePointerCaptureProvider extends InputCaptureProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCapturing() {
|
||||
public boolean isCapturingActive() {
|
||||
return targetView.hasPointerCapture();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,22 +9,21 @@ import com.limelight.binding.input.evdev.EvdevListener;
|
||||
|
||||
public class InputCaptureManager {
|
||||
public static InputCaptureProvider getInputCaptureProvider(Activity activity, EvdevListener rootListener) {
|
||||
// Shield capture is preferred because it can capture when the cursor is over
|
||||
// the system UI. Android N native capture can only capture over views owned
|
||||
// by the application.
|
||||
if (ShieldCaptureProvider.isCaptureProviderSupported()) {
|
||||
LimeLog.info("Using NVIDIA mouse capture extension");
|
||||
return new ShieldCaptureProvider(activity);
|
||||
}
|
||||
else if (AndroidNativePointerCaptureProvider.isCaptureProviderSupported()) {
|
||||
if (AndroidNativePointerCaptureProvider.isCaptureProviderSupported()) {
|
||||
LimeLog.info("Using Android O+ native mouse capture");
|
||||
return new AndroidNativePointerCaptureProvider(activity.findViewById(R.id.surfaceView));
|
||||
}
|
||||
else if (ShieldCaptureProvider.isCaptureProviderSupported()) {
|
||||
LimeLog.info("Using NVIDIA mouse capture extension");
|
||||
return new ShieldCaptureProvider(activity);
|
||||
}
|
||||
else if (EvdevCaptureProvider.isCaptureProviderSupported()) {
|
||||
LimeLog.info("Using Evdev mouse capture");
|
||||
return new EvdevCaptureProvider(activity, rootListener);
|
||||
}
|
||||
else if (AndroidPointerIconCaptureProvider.isCaptureProviderSupported()) {
|
||||
// Android N's native capture can't capture over system UI elements
|
||||
// so we want to only use it if there's no other option.
|
||||
LimeLog.info("Using Android N+ pointer hiding");
|
||||
return new AndroidPointerIconCaptureProvider(activity);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@ public abstract class InputCaptureProvider {
|
||||
|
||||
public void destroy() {}
|
||||
|
||||
public boolean isCapturing() {
|
||||
public boolean isCapturingEnabled() {
|
||||
return isCapturing;
|
||||
}
|
||||
|
||||
public boolean isCapturingActive() {
|
||||
return isCapturing;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user