Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 824d8965832ac280b6a10458cd8592217f3ce517
      
https://github.com/WebKit/WebKit/commit/824d8965832ac280b6a10458cd8592217f3ce517
  Author: Alejandro G. Castro <[email protected]>
  Date:   2026-07-02 (Thu, 02 Jul 2026)

  Changed paths:
    M Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestInputMethodContext.cpp

  Log Message:
  -----------
  [WPE] Do not show the on-screen keyboard when an element is focused 
programmatically
https://bugs.webkit.org/show_bug.cgi?id=318353

Reviewed by Carlos Alberto Lopez Perez.

When an editable element becomes focused, the GLib ports activate the platform
input method. On a Wayland compositor that provides an on-screen keyboard, this
raises the OSK. It currently happens for every focus change, including focus
driven by script (element.focus()) without any user interaction. Web content
commonly focuses a field programmatically, on load via autofocus, on client-
side navigation, or when a component mounts, so the on-screen keyboard is
raised unexpectedly, covering content, even though the user never indicated an
intent to type.

Other engines, and WebKit's own iOS port, only present the keyboard when the
focus is the result of a user interaction (iOS gates this in
[WKContentView _elementDidFocus:userIsInteracting:...]). The GLib ports have no
equivalent gate: the view forwards the focused element to the input method
unconditionally, which activates the Wayland text-input protocol and lets the
compositor raise the OSK.

Modified the API tests checking this.

* Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:
(WebKit::WebPage::setInputMethodState):
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestInputMethodContext.cpp:
(testWebKitInputMethodContextContentType):

Canonical link: https://commits.webkit.org/316375@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to