mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
Fix gesture handling while selecting text
Also remove stray debug logging.
This commit is contained in:
@@ -117,7 +117,6 @@ public final class TerminalView extends View {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onScroll(MotionEvent e2, float distanceX, float distanceY) {
|
public boolean onScroll(MotionEvent e2, float distanceX, float distanceY) {
|
||||||
Log.e("termux", "onScroll=" + e2 + ", mIsselection=" + mIsSelectingText + ", mouse=" + e2.isFromSource(InputDevice.SOURCE_MOUSE));
|
|
||||||
if (mEmulator == null || mIsSelectingText) return true;
|
if (mEmulator == null || mIsSelectingText) return true;
|
||||||
if (mEmulator.isMouseTrackingActive() && e2.isFromSource(InputDevice.SOURCE_MOUSE)) {
|
if (mEmulator.isMouseTrackingActive() && e2.isFromSource(InputDevice.SOURCE_MOUSE)) {
|
||||||
// If moving with mouse pointer while pressing button, report that instead of scroll.
|
// If moving with mouse pointer while pressing button, report that instead of scroll.
|
||||||
@@ -136,6 +135,7 @@ public final class TerminalView extends View {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onScale(float focusX, float focusY, float scale) {
|
public boolean onScale(float focusX, float focusY, float scale) {
|
||||||
|
if (mEmulator == null || mIsSelectingText) return true;
|
||||||
mScaleFactor *= scale;
|
mScaleFactor *= scale;
|
||||||
mScaleFactor = mOnKeyListener.onScale(mScaleFactor);
|
mScaleFactor = mOnKeyListener.onScale(mScaleFactor);
|
||||||
return true;
|
return true;
|
||||||
@@ -502,8 +502,7 @@ public final class TerminalView extends View {
|
|||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) mActionMode.invalidateContentRect();
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) mActionMode.invalidateContentRect();
|
||||||
invalidate();
|
invalidate();
|
||||||
// Return to prevent gestures when moving while selecting text.
|
break;
|
||||||
return true;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user