Skip to content

Commit

Permalink
Cherry-pick 278261@main (f69bdc3). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=218148

    [GTK] Don't notify cursor when cursorRect is default-initialized
    https://bugs.webkit.org/show_bug.cgi?id=218148

    Reviewed by Michael Catanzaro.

    For input methods in preedit mode, editor state update functions could
    get an IntRect that is default-initialized (with x, y, width and height
    all 0), which makes the input method popup at the top left corner
    instead of its expected position.

    * Source/WebKit/UIProcess/API/glib/InputMethodFilter.cpp:
    (WebKit::InputMethodFilter::notifyCursorRect): Modified to check if
    cursorRect is default-initialized.

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

Canonical link: https://commits.webkit.org/274313.200@webkitglib/2.44
  • Loading branch information
taoky authored and aperezdc committed May 2, 2024
1 parent b0737e8 commit 8cf816e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebKit/UIProcess/API/glib/InputMethodFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ void InputMethodFilter::notifyCursorRect(const IntRect& cursorRect)
if (!isEnabled() || !m_context)
return;

// Don't notify cursor area when cursorRect is default-initialized (location and size are all 0).
if (!cursorRect.x() && !cursorRect.y() && !cursorRect.width() && !cursorRect.height())
return;

// Don't move the window unless the cursor actually moves more than 10
// pixels. This prevents us from making the window flash during minor
// cursor adjustments.
Expand Down

0 comments on commit 8cf816e

Please sign in to comment.