diff options
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 5 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsWindow.java | 25 |
2 files changed, 20 insertions, 10 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 7fd672233f2..278c6025902 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java | |||
| @@ -590,16 +590,17 @@ public final class EmacsView extends ViewGroup | |||
| 590 | super.onAttachedToWindow (); | 590 | super.onAttachedToWindow (); |
| 591 | } | 591 | } |
| 592 | 592 | ||
| 593 | public synchronized void | 593 | public void |
| 594 | showOnScreenKeyboard () | 594 | showOnScreenKeyboard () |
| 595 | { | 595 | { |
| 596 | /* Specifying no flags at all tells the system the user asked for | 596 | /* Specifying no flags at all tells the system the user asked for |
| 597 | the input method to be displayed. */ | 597 | the input method to be displayed. */ |
| 598 | |||
| 598 | imManager.showSoftInput (this, 0); | 599 | imManager.showSoftInput (this, 0); |
| 599 | isCurrentlyTextEditor = true; | 600 | isCurrentlyTextEditor = true; |
| 600 | } | 601 | } |
| 601 | 602 | ||
| 602 | public synchronized void | 603 | public void |
| 603 | hideOnScreenKeyboard () | 604 | hideOnScreenKeyboard () |
| 604 | { | 605 | { |
| 605 | imManager.hideSoftInputFromWindow (this.getWindowToken (), | 606 | imManager.hideSoftInputFromWindow (this.getWindowToken (), |
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index f5e40e9a2d9..68a18ec2aa7 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java | |||
| @@ -1201,16 +1201,25 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 1201 | } | 1201 | } |
| 1202 | 1202 | ||
| 1203 | public void | 1203 | public void |
| 1204 | toggleOnScreenKeyboard (boolean on) | 1204 | toggleOnScreenKeyboard (final boolean on) |
| 1205 | { | 1205 | { |
| 1206 | /* InputMethodManager functions are thread safe. Call | 1206 | /* Even though InputMethodManager functions are thread safe, |
| 1207 | `showOnScreenKeyboard' etc from the Emacs thread in order to | 1207 | `showOnScreenKeyboard' etc must be called from the UI thread in |
| 1208 | keep the calls in sync with updates to the input context. */ | 1208 | order to avoid deadlocks if the calls happen in tandem with a |
| 1209 | call to a synchronizing function within | ||
| 1210 | `onCreateInputConnection'. */ | ||
| 1209 | 1211 | ||
| 1210 | if (on) | 1212 | EmacsService.SERVICE.runOnUiThread (new Runnable () { |
| 1211 | view.showOnScreenKeyboard (); | 1213 | @Override |
| 1212 | else | 1214 | public void |
| 1213 | view.hideOnScreenKeyboard (); | 1215 | run () |
| 1216 | { | ||
| 1217 | if (on) | ||
| 1218 | view.showOnScreenKeyboard (); | ||
| 1219 | else | ||
| 1220 | view.hideOnScreenKeyboard (); | ||
| 1221 | } | ||
| 1222 | }); | ||
| 1214 | } | 1223 | } |
| 1215 | 1224 | ||
| 1216 | public String | 1225 | public String |