* java/org/gnu/emacs/EmacsView.java (EmacsView)
(showOnScreenKeyboard, hideOnScreenKeyboard)
(onCheckIsTextEditor): Make synchronized.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
(toggleOnScreenKeyboard): Don't post to the main thread.
super.onAttachedToWindow ();
}
- public void
+ public synchronized void
showOnScreenKeyboard ()
{
/* Specifying no flags at all tells the system the user asked for
isCurrentlyTextEditor = true;
}
- public void
+ public synchronized void
hideOnScreenKeyboard ()
{
imManager.hideSoftInputFromWindow (this.getWindowToken (),
}
@Override
- public boolean
+ public synchronized boolean
onCheckIsTextEditor ()
{
/* If value is true, then the system will display the on screen
}
public void
- toggleOnScreenKeyboard (final boolean on)
+ toggleOnScreenKeyboard (boolean on)
{
- EmacsService.SERVICE.runOnUiThread (new Runnable () {
- @Override
- public void
- run ()
- {
- if (on)
- view.showOnScreenKeyboard ();
- else
- view.hideOnScreenKeyboard ();
- }
- });
+ /* InputMethodManager functions are thread safe. Call
+ `showOnScreenKeyboard' etc from the Emacs thread in order to
+ keep the calls in sync with updates to the input context. */
+
+ if (on)
+ view.showOnScreenKeyboard ();
+ else
+ view.hideOnScreenKeyboard ();
}
public String