diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 34682feeedb..052793eabaf 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -387,6 +387,23 @@ invocation of app_process (through android-emacs) can EmacsService.syncRunnable (task); } + public void + getLocationInWindow (final EmacsView view, final int[] coordinates) + { + FutureTask task; + + task = new FutureTask (new Callable () { + public Void + call () + { + view.getLocationInWindow (coordinates); + return null; + } + }); + + EmacsService.syncRunnable (task); + } + public static void diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 91e97fa8b61..911e082144e 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -1551,10 +1551,11 @@ else if (EmacsWindow.this.isMapped) { int[] array; - /* This is supposed to translate coordinates to the root - window. */ + /* This is supposed to translate coordinates to the root window, + whose origin point, in this context, is that of the toplevel + activity host to this view. */ array = new int[2]; - EmacsService.SERVICE.getLocationOnScreen (view, array); + EmacsService.SERVICE.getLocationInWindow (view, array); /* Now, the coordinates of the view should be in array. Offset X and Y by them. */