* java/org/gnu/emacs/EmacsService.java (getLocationInWindow):
New function.
* java/org/gnu/emacs/EmacsWindow.java (translateCoordinates):
Derive "root window" position from the origin point of the
containing activity's window rather than that of the screen,
the two of which differ when "freeform mode" is enabled.
(cherry picked from commit
8ee1dc8f1f9aa47260f8151c9eea30fb1ccf878a)
EmacsService.<Void>syncRunnable (task);
}
+ public void
+ getLocationInWindow (final EmacsView view, final int[] coordinates)
+ {
+ FutureTask<Void> task;
+
+ task = new FutureTask<Void> (new Callable<Void> () {
+ public Void
+ call ()
+ {
+ view.getLocationInWindow (coordinates);
+ return null;
+ }
+ });
+
+ EmacsService.<Void>syncRunnable (task);
+ }
+
\f
public static void
{
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. */