1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #114465 from m4gr3d/fix_editor_hybrid_app_support_detection

[Android editor] Restrict Android editor support for hybrid app projects to XR devices
This commit is contained in:
Rémi Verschelde
2026-01-01 16:47:59 +01:00
4 changed files with 6 additions and 8 deletions

View File

@@ -104,8 +104,8 @@ abstract class BaseGodotGame: GodotEditor() {
@CallSuper
override fun supportsFeature(featureTag: String): Boolean {
if (HYBRID_APP_FEATURE == featureTag) {
// Check if hybrid is enabled
return isHybridAppEnabled()
// Check if hybrid is enabled.
return godot?.isXrRuntime == true && isHybridAppEnabled()
}
return super.supportsFeature(featureTag)

View File

@@ -135,6 +135,8 @@ class Godot private constructor(val context: Context) {
private val gyroscopeEnabled = AtomicBoolean(false)
private val mGyroscope: Sensor? by lazy { mSensorManager?.getDefaultSensor(Sensor.TYPE_GYROSCOPE) }
val isXrRuntime: Boolean by lazy { hasFeature("xr_runtime") }
val tts = GodotTTS(context)
val directoryAccessHandler = DirectoryAccessHandler(context)
val fileAccessHandler = FileAccessHandler(context)

View File

@@ -80,13 +80,11 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
private final GodotInputHandler inputHandler;
private final GodotRenderer godotRenderer;
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
private final boolean isXrDevice;
public GodotGLRenderView(Godot godot, GodotInputHandler inputHandler, XRMode xrMode, boolean useDebugOpengl, boolean shouldBeTranslucent) {
super(godot.getContext());
this.godot = godot;
isXrDevice = godot.hasFeature("xr_runtime");
this.inputHandler = inputHandler;
this.godotRenderer = new GodotRenderer();
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
@@ -177,7 +175,7 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
@Override
public boolean canCapturePointer() {
// Pointer capture is not supported on XR devices.
return !isXrDevice && inputHandler.canCapturePointer();
return !godot.isXrRuntime() && inputHandler.canCapturePointer();
}
@Override

View File

@@ -55,13 +55,11 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
private final GodotInputHandler mInputHandler;
private final VkRenderer mRenderer;
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
private final boolean isXrDevice;
public GodotVulkanRenderView(Godot godot, GodotInputHandler inputHandler, boolean shouldBeTranslucent) {
super(godot.getContext());
this.godot = godot;
isXrDevice = godot.hasFeature("xr_runtime");
mInputHandler = inputHandler;
mRenderer = new VkRenderer();
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
@@ -156,7 +154,7 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
@Override
public boolean canCapturePointer() {
// Pointer capture is not supported on XR devices.
return !isXrDevice && mInputHandler.canCapturePointer();
return !godot.isXrRuntime() && mInputHandler.canCapturePointer();
}
@Override
public void requestPointerCapture() {