summaryrefslogtreecommitdiffstats
path: root/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-05-16 18:16:04 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-05-16 18:16:04 +0300
commit231d3670981a33ec42b91ad1cb33c1fc50551066 (patch)
treeb1ef1096f4e279baaa2ea0d2daf14b5c4185a82f /src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
parentffdd372c7bbda62e9d937f406319f38e3e982774 (diff)
parent8fc1a885d19a2dfb1a3a684aea1cfa41967e041f (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Diffstat (limited to 'src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
index 38cc695c37..feb47c8f90 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
@@ -159,11 +159,15 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
public void setPosition(final int x, final int y){
initOverlay();
- final int[] location = new int[2];
- m_layout.getLocationOnScreen(location);
+ final int[] layoutLocation = new int[2];
+ m_layout.getLocationOnScreen(layoutLocation);
+
+ // This value is used for handling split screen case
+ final int[] activityLocation = new int[2];
+ m_activity.getWindow().getDecorView().getLocationOnScreen(activityLocation);
- int x2 = x + location[0];
- int y2 = y + location[1] + m_yShift;
+ int x2 = x + layoutLocation[0] - activityLocation[0];
+ int y2 = y + layoutLocation[1] + m_yShift - activityLocation[1];
if (m_id == QtNative.IdCursorHandle) {
x2 -= m_popup.getWidth() / 2 ;