[Scummvm-git-logs] scummvm master -> 97c3ac5c2c92cd452bcfc905d1f56b20445dee84

bluegr bluegr at gmail.com
Sat Jan 11 16:03:06 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
97c3ac5c2c ANDROID: Hide the system mouse cursor on Android N


Commit: 97c3ac5c2c92cd452bcfc905d1f56b20445dee84
    https://github.com/scummvm/scummvm/commit/97c3ac5c2c92cd452bcfc905d1f56b20445dee84
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-01-11T18:03:02+02:00

Commit Message:
ANDROID: Hide the system mouse cursor on Android N

Changed paths:
    backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java


diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index f55639f..20fa482 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -21,6 +21,7 @@ import android.view.View;
 import android.view.SurfaceView;
 import android.view.SurfaceHolder;
 import android.view.MotionEvent;
+import android.view.PointerIcon;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.ImageView;
 import android.widget.Toast;
@@ -403,13 +404,19 @@ public class ScummVMActivity extends Activity {
 	}
 
 	private void showMouseCursor(boolean show) {
-		/* Currently hiding the system mouse cursor is only
-		   supported on OUYA.  If other systems provide similar
-		   intents, please add them here as well */
-		Intent intent =
-			new Intent(show?
-				   "tv.ouya.controller.action.SHOW_CURSOR" :
-				   "tv.ouya.controller.action.HIDE_CURSOR");
-		sendBroadcast(intent);
+		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+			SurfaceView main_surface = (SurfaceView)findViewById(R.id.main_surface);
+			int type = show ? PointerIcon.TYPE_DEFAULT : PointerIcon.TYPE_NULL;
+			main_surface.setPointerIcon(PointerIcon.getSystemIcon(this, type));
+		} else {
+			/* Currently hiding the system mouse cursor is only
+			   supported on OUYA.  If other systems provide similar
+			   intents, please add them here as well */
+			Intent intent =
+				new Intent(show?
+					   "tv.ouya.controller.action.SHOW_CURSOR" :
+					   "tv.ouya.controller.action.HIDE_CURSOR");
+			sendBroadcast(intent);
+		}
 	}
 }




More information about the Scummvm-git-logs mailing list