diff options
| author | Po Lu | 2023-03-14 13:19:01 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-14 13:19:01 +0800 |
| commit | d6bddca26c7cf827e098ae783e865fcbcdd48799 (patch) | |
| tree | aba22e667c97e4418e84171309f46b9f2e4e7509 /java | |
| parent | 5964051fcefc52e02c88a41b91797cc7a785d550 (diff) | |
| download | emacs-d6bddca26c7cf827e098ae783e865fcbcdd48799.tar.gz emacs-d6bddca26c7cf827e098ae783e865fcbcdd48799.zip | |
Update Android port
* java/org/gnu/emacs/EmacsWindow.java (figureChange): Detect
mice on up events as well.
(onSomeKindOfMotionEvent): Work past framework bug.
* src/androidterm.c (android_perform_conversion_query):
* src/textconv.c (textconv_query):
* src/textconv.h (TEXTCONV_SKIP_ACTIVE_REGION): Remove unused
code.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsWindow.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index d786c104153..a8d1beedef7 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java | |||
| @@ -755,6 +755,14 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 755 | break; | 755 | break; |
| 756 | 756 | ||
| 757 | case MotionEvent.ACTION_UP: | 757 | case MotionEvent.ACTION_UP: |
| 758 | |||
| 759 | /* Detect mice. If this is a mouse event, give it to | ||
| 760 | onSomeKindOfMotionEvent. */ | ||
| 761 | if ((Build.VERSION.SDK_INT | ||
| 762 | >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) | ||
| 763 | && event.getToolType (0) == MotionEvent.TOOL_TYPE_MOUSE) | ||
| 764 | return -2; | ||
| 765 | |||
| 758 | /* Primary pointer released with index 0. */ | 766 | /* Primary pointer released with index 0. */ |
| 759 | pointerID = event.getPointerId (0); | 767 | pointerID = event.getPointerId (0); |
| 760 | pointerMap.remove (pointerID); | 768 | pointerMap.remove (pointerID); |
| @@ -916,6 +924,7 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 916 | EmacsNative.sendLeaveNotify (this.handle, (int) event.getX (), | 924 | EmacsNative.sendLeaveNotify (this.handle, (int) event.getX (), |
| 917 | (int) event.getY (), | 925 | (int) event.getY (), |
| 918 | event.getEventTime ()); | 926 | event.getEventTime ()); |
| 927 | |||
| 919 | return true; | 928 | return true; |
| 920 | 929 | ||
| 921 | case MotionEvent.ACTION_BUTTON_PRESS: | 930 | case MotionEvent.ACTION_BUTTON_PRESS: |
| @@ -949,13 +958,35 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 949 | return true; | 958 | return true; |
| 950 | 959 | ||
| 951 | case MotionEvent.ACTION_DOWN: | 960 | case MotionEvent.ACTION_DOWN: |
| 952 | case MotionEvent.ACTION_UP: | ||
| 953 | /* Emacs must return true even though touch events are not | 961 | /* Emacs must return true even though touch events are not |
| 954 | handled here, because the value of this function is used by | 962 | handled here, because the value of this function is used by |
| 955 | the system to decide whether or not Emacs gets ACTION_MOVE | 963 | the system to decide whether or not Emacs gets ACTION_MOVE |
| 956 | events. */ | 964 | events. */ |
| 957 | return true; | 965 | return true; |
| 958 | 966 | ||
| 967 | case MotionEvent.ACTION_UP: | ||
| 968 | /* However, if ACTION_UP reports a different button state from | ||
| 969 | the last known state, look up which button was released and | ||
| 970 | send a ButtonRelease event; this is to work around a bug in | ||
| 971 | the framework where real ACTION_BUTTON_RELEASE events are | ||
| 972 | not delivered. */ | ||
| 973 | |||
| 974 | if (Build.VERSION.SDK_INT | ||
| 975 | < Build.VERSION_CODES.ICE_CREAM_SANDWICH) | ||
| 976 | return true; | ||
| 977 | |||
| 978 | if (event.getButtonState () == 0 && lastButtonState != 0) | ||
| 979 | { | ||
| 980 | EmacsNative.sendButtonRelease (this.handle, (int) event.getX (), | ||
| 981 | (int) event.getY (), | ||
| 982 | event.getEventTime (), | ||
| 983 | lastModifiers, | ||
| 984 | whatButtonWasIt (event, false)); | ||
| 985 | lastButtonState = event.getButtonState (); | ||
| 986 | } | ||
| 987 | |||
| 988 | return true; | ||
| 989 | |||
| 959 | case MotionEvent.ACTION_SCROLL: | 990 | case MotionEvent.ACTION_SCROLL: |
| 960 | /* Send a scroll event with the specified deltas. */ | 991 | /* Send a scroll event with the specified deltas. */ |
| 961 | EmacsNative.sendWheel (this.handle, (int) event.getX (), | 992 | EmacsNative.sendWheel (this.handle, (int) event.getX (), |