Bug 256080

Summary: [GTK4] Emoji chooser popover does not point to the caret location
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, cgarcia, guillaume.webkit, mcatanzaro, webkit-bugzilla
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=212330
Bug Depends on:    
Bug Blocks: 210100    
Attachments:
Description Flags
Screenshot showing the emoji chooser opened at the wrong location none

Description Adrian Perez 2023-04-28 01:06:17 PDT
Created attachment 466124 [details]
Screenshot showing the emoji chooser opened at the wrong location

Opening the emoji chooser with Ctrl-; always shows the popover pointing
to the top-left corner of the web view widget. The correct thing to do
would be to point at the current location of the text caret. Note that
this is only a GTK4 issue, GTK3 works well.
Comment 1 Adrian Perez 2023-04-28 01:37:39 PDT
*** Bug 256082 has been marked as a duplicate of this bug. ***
Comment 2 Adrian Perez 2023-04-28 01:38:01 PDT
Some investigation: using the “Insert Emoji” option from the
context menu for the input field works as expected, and code
execution goes through webkitWebViewBaseShowEmojiChooser() and
emojiChooserClosedemojiChooserEmojiPicked() -- it's only using
the keyboard to open the chooser with Ctrl-; that doesn't work
and these two functions aren't executed.
Comment 3 Adrian Perez 2023-04-28 04:48:38 PDT
(In reply to Adrian Perez from comment #2)
> Some investigation: using the “Insert Emoji” option from the
> context menu for the input field works as expected, and code
> execution goes through webkitWebViewBaseShowEmojiChooser() and
> emojiChooserClosedemojiChooserEmojiPicked() -- it's only using
> the keyboard to open the chooser with Ctrl-; that doesn't work
> and these two functions aren't executed.

Using Ctrl-. or Ctrl-; does NOT result in the insertEmojiCallback()
function from Source/WebKit/UIProcess/gtk/KeyBindingTranslator.cpp
being called. I think GTK is trying to handle popping the chooser
by itself, so of course it does not know where to input the picked
emoji nor it knows where to point the popover to (because we are
only setting the parent, the default position is 0,0).