Resolve disagreements in accounting of tooltip positions on Android
* 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.
This commit is contained in:
parent
c7a0e4faa2
commit
8ee1dc8f1f
2 changed files with 21 additions and 3 deletions
|
@ -387,6 +387,23 @@ invocation of app_process (through android-emacs) can
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void
|
||||
|
|
|
@ -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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue