aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-07-09 12:50:15 +0800
committerPo Lu2023-07-09 12:50:15 +0800
commit97f926b82d5674f90a16327b0ad4d6b226fcacb4 (patch)
treebbdf5de2ad210800368c1304d415bd3843d3611e /java
parent8afb5644fd21162f8fd6c39f111844b79e002b7c (diff)
downloademacs-97f926b82d5674f90a16327b0ad4d6b226fcacb4.tar.gz
emacs-97f926b82d5674f90a16327b0ad4d6b226fcacb4.zip
Update Android port
* java/org/gnu/emacs/EmacsService.java (onStartCommand): Fix typo in notification message. * java/org/gnu/emacs/EmacsWindow.java (onFocusChanged): Reset the recorded modifier state upon a change to the window focus.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsService.java2
-rw-r--r--java/org/gnu/emacs/EmacsWindow.java9
2 files changed, 9 insertions, 2 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java
index a7e83e276f2..0543c3a1bdd 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -147,7 +147,7 @@ public final class EmacsService extends Service
147 manager = (NotificationManager) tem; 147 manager = (NotificationManager) tem;
148 infoBlurb = ("This notification is displayed to keep Emacs" 148 infoBlurb = ("This notification is displayed to keep Emacs"
149 + " running while it is in the background. You" 149 + " running while it is in the background. You"
150 + " may disable if you want;" 150 + " may disable it if you want;"
151 + " see (emacs)Android Environment."); 151 + " see (emacs)Android Environment.");
152 channel 152 channel
153 = new NotificationChannel ("emacs", "Emacs persistent notification", 153 = new NotificationChannel ("emacs", "Emacs persistent notification",
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java
index 739a1f43b7d..2d8a8627468 100644
--- a/java/org/gnu/emacs/EmacsWindow.java
+++ b/java/org/gnu/emacs/EmacsWindow.java
@@ -99,7 +99,8 @@ public final class EmacsWindow extends EmacsHandleObject
99 private EmacsGC scratchGC; 99 private EmacsGC scratchGC;
100 100
101 /* The button state and keyboard modifier mask at the time of the 101 /* The button state and keyboard modifier mask at the time of the
102 last button press or release event. */ 102 last button press or release event. The modifier mask is reset
103 upon each window focus change. */
103 public int lastButtonState, lastModifiers; 104 public int lastButtonState, lastModifiers;
104 105
105 /* Whether or not the window is mapped. */ 106 /* Whether or not the window is mapped. */
@@ -670,6 +671,12 @@ public final class EmacsWindow extends EmacsHandleObject
670 onFocusChanged (boolean gainFocus) 671 onFocusChanged (boolean gainFocus)
671 { 672 {
672 EmacsActivity.invalidateFocus (); 673 EmacsActivity.invalidateFocus ();
674
675 /* If focus has been lost, reset the keyboard modifier state, as
676 subsequent changes will not be recorded. */
677
678 if (!gainFocus)
679 lastModifiers = 0;
673 } 680 }
674 681
675 /* Notice that the activity has been detached or destroyed. 682 /* Notice that the activity has been detached or destroyed.