Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a375876 authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Set mShiftIsPressed properly when the focus is a plugin.

Fix for http://b/issue?id=2484986

Change-Id: I3140c3c3a0bd44af85939aceb0bbd07c0861cde4
parent f53774bc
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -3691,12 +3691,14 @@ public class WebView extends AbsoluteLayout
            return false;
        }

        if (mShiftIsPressed == false && nativeCursorWantsKeyEvents() == false
                && !nativeFocusIsPlugin()
                && (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
                || keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT)) {
        if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
                || keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
            if (nativeFocusIsPlugin()) {
                mShiftIsPressed = true;
            } else if (!nativeCursorWantsKeyEvents() && !mShiftIsPressed) {
                setUpSelectXY();
            }
        }

        if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
                && keyCode <= KeyEvent.KEYCODE_DPAD_RIGHT) {
@@ -3834,7 +3836,10 @@ public class WebView extends AbsoluteLayout

        if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
                || keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
            if (commitCopy()) {
            if (nativeFocusIsPlugin()) {
                mShiftIsPressed = false;
                return true;
            } else if (commitCopy()) {
                return true;
            }
        }
@@ -4195,7 +4200,9 @@ public class WebView extends AbsoluteLayout
    public boolean dispatchKeyEvent(KeyEvent event) {
        boolean dispatch = true;

        if (!inEditingMode()) {
        // Textfields and plugins need to receive the shift up key even if
        // another key was released while the shift key was held down.
        if (!inEditingMode() && !nativeFocusIsPlugin()) {
            if (event.getAction() == KeyEvent.ACTION_DOWN) {
                mGotKeyDown = true;
            } else {