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

Commit 8cdad889 authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Make the caret/selection draw when gaining window focus.

When the WebView loses WindowFocus, we stop drawing the
selection.  We need to resume drawing it, especially for
the context menu, which steals WindowFocus.  Corresponds
to a change in Webkit.
parent 5e79e323
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3510,6 +3510,9 @@ public class WebView extends AbsoluteLayout
                mDrawCursorRing = true;
                if (mNativeClass != 0) {
                    nativeRecordButtons(true, false, true);
                    if (inEditingMode()) {
                        mWebViewCore.sendMessage(EventHub.SET_ACTIVE, 1, 0);
                    }
                }
            } else {
                // If our window gained focus, but we do not have it, do not
@@ -3552,7 +3555,7 @@ public class WebView extends AbsoluteLayout
        // Do not need to also check whether mWebViewCore is null, because
        // mNativeClass is only set if mWebViewCore is non null
        if (mNativeClass == 0) return;
        mWebViewCore.sendMessage(EventHub.SET_INACTIVE);
        mWebViewCore.sendMessage(EventHub.SET_ACTIVE, 0, 0);
    }

    @Override
+5 −5
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ final class WebViewCore {
            String currentText, int keyCode, int keyValue, boolean down,
            boolean cap, boolean fn, boolean sym);

    private native void nativeSetFocusControllerInactive();
    private native void nativeSetFocusControllerActive(boolean active);

    private native void nativeSaveDocumentState(int frame);

@@ -613,7 +613,7 @@ final class WebViewCore {
            "LOAD_DATA", // = 139;
            "TOUCH_UP", // = 140;
            "TOUCH_EVENT", // = 141;
            "SET_INACTIVE", // = 142;
            "SET_ACTIVE", // = 142;
            "ON_PAUSE",     // = 143
            "ON_RESUME",    // = 144
            "FREE_MEMORY",  // = 145
@@ -671,7 +671,7 @@ final class WebViewCore {
        // Used to tell the focus controller not to draw the blinking cursor,
        // based on whether the WebView has focus and whether the WebView's
        // cursor matches the webpage's focus.
        static final int SET_INACTIVE = 142;
        static final int SET_ACTIVE = 142;

        // lifecycle activities for just this DOM (unlike pauseTimers, which
        // is global)
@@ -954,8 +954,8 @@ final class WebViewCore {
                            break;
                        }

                        case SET_INACTIVE:
                            nativeSetFocusControllerInactive();
                        case SET_ACTIVE:
                            nativeSetFocusControllerActive(msg.arg1 == 1);
                            break;

                        case ADD_JS_INTERFACE: