diff --git a/app/src/main/java/xtr/keymapper/TouchPointer.java b/app/src/main/java/xtr/keymapper/TouchPointer.java index 0e3383e4..105e5c07 100644 --- a/app/src/main/java/xtr/keymapper/TouchPointer.java +++ b/app/src/main/java/xtr/keymapper/TouchPointer.java @@ -223,6 +223,20 @@ public void switchProfiles() { mHandler.post(() -> { @Override public void enablePointer() { + KeymapConfig keymapConfig = requestKeymapConfig(); + + // Set combined pointer mode automatically for 14 QPR3 and above + if (keymapConfig.pointerMode == KeymapConfig.POINTER_OVERLAY) { + keymapConfig.pointerMode = KeymapConfig.POINTER_COMBINED; + keymapConfig.applySharedPrefs(); + activityCallback.stopPointer(); + try { + mService.stopServer(); + } catch (RemoteException ignored) { + } + return; + } + mHandler.post(() -> { if(cursorView == null) { cursorView = CursorBinding.inflate(LayoutInflater.from( diff --git a/app/src/main/java/xtr/keymapper/server/InputService.java b/app/src/main/java/xtr/keymapper/server/InputService.java index ccc3c8f3..b335c2d6 100644 --- a/app/src/main/java/xtr/keymapper/server/InputService.java +++ b/app/src/main/java/xtr/keymapper/server/InputService.java @@ -47,9 +47,8 @@ public InputService(KeymapProfile profile, KeymapConfig keymapConfig, IRemoteSer // Reduce visibility of system pointer cursorSetX(0); cursorSetY(0); - } else if (cursorView == null) { - showCursor(); } + if (currentPointerMode != KeymapConfig.POINTER_SYSTEM) showCursor(); this.touchpadInputMode = keymapConfig.touchpadInputMode; if (touchpadInputMode == KeymapConfig.TOUCHPAD_DIRECT) diff --git a/app/src/main/java/xtr/keymapper/server/RemoteService.java b/app/src/main/java/xtr/keymapper/server/RemoteService.java index a2bab5ef..21ddde20 100644 --- a/app/src/main/java/xtr/keymapper/server/RemoteService.java +++ b/app/src/main/java/xtr/keymapper/server/RemoteService.java @@ -237,7 +237,7 @@ public void startServer(KeymapProfile profile, KeymapConfig keymapConfig, IRemot @Override public void stopServer() { if (!startedFromShell) { - try { + if (inputService != null) try { inputService.getCallback().disablePointer(); } catch (RemoteException e) { throw new RuntimeException(e);