<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>260602</bug_id>
          
          <creation_ts>2023-08-23 00:22:35 -0700</creation_ts>
          <short_desc>[GTK] Ctrl+&lt;key&gt; no longer sends keydown events</short_desc>
          <delta_ts>2023-09-08 13:40:54 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>MOVED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=261348</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pierre Ossman">ossman</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1972919</commentid>
    <comment_count>0</comment_count>
    <who name="Pierre Ossman">ossman</who>
    <bug_when>2023-08-23 00:22:35 -0700</bug_when>
    <thetext>Something is currently very broken in the keyboard handling in Epiphany. It fails to send keydown events when Ctrl is pressed. This has a massive impact on applications that are keyboard focused, such as remote desktop tools (issue first seen in VMware).

You can easily test the bug by simply pressing Ctrl+C in the form here:

https://w3c.github.io/uievents/tools/key-event-viewer.html

When I do that here, I get:

1. keydown Control
2. keyup C
3. keyup Control

There should have been a keydown C between 1 and 2.

Tested with:

webkitgtk6.0-2.40.5-1.fc38.x86_64
epiphany-44.6-1.fc38.x86_64

Fedora 38 with Xorg.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973364</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-08-24 15:03:55 -0700</bug_when>
    <thetext>When you say &quot;no longer sends&quot; I presume that means you know it used to work properly? Would sure help if we knew when it broke.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973469</commentid>
    <comment_count>2</comment_count>
    <who name="Pierre Ossman">ossman</who>
    <bug_when>2023-08-25 00:28:11 -0700</bug_when>
    <thetext>I&apos;m fairly certain this worked fine before my recent upgrade from Fedora 36 to Fedora 38. I use VMware fairly regularly, and it would be odd if I only just now happened to notice that Ctrl+C doesn&apos;t work. I think it is more likely it broke in the upgrade I just performed.

On the other hand, the WebKit version in Fedora 36 seems to have been about the same:

webkit2gtk3-2.40.1-1.fc36.x86_64

I cannot find a WebKit for GTK 4 among the Fedora 36 packages. Perhaps this is caused by a switch from GTK 3 to GTK 4?

The Epiphany package in Fedora 36 was:

epiphany-1:42.5-1.fc36.x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973501</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-08-25 05:49:57 -0700</bug_when>
    <thetext>Probably a GTK 3 -&gt; GTK 4 change, then, indeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975872</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-06 12:23:28 -0700</bug_when>
    <thetext>Well, unlikely as it might seem, this is actually an Epiphany bug. MiniBrowser is fine. Please report this on the Epiphany issue tracker; we can continue there. Epiphany has some code to try to ensure websites cannot hijack standard keyboard shortcuts like Ctrl+T and probably something is broken with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975873</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-06 12:25:11 -0700</bug_when>
    <thetext>&gt; Epiphany has some code to try to ensure websites cannot hijack standard keyboard shortcuts like Ctrl+T and probably something is broken with that.

Actually, all of that code is currently disabled due to https://gitlab.gnome.org/GNOME/epiphany/-/issues/1915. I have no clue what is going wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975999</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-06 17:32:44 -0700</bug_when>
    <thetext>The WebKitWebView is not receiving the missing key press event at all. EphyWindow does see the event, but it never makes it to the WebKitWebView. Something in between is eating the event, and there&apos;s not a lot in between.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976007</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-06 17:57:52 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #6)
&gt; The WebKitWebView is not receiving the missing key press event at all.
&gt; EphyWindow does see the event, but it never makes it to the WebKitWebView.
&gt; Something in between is eating the event, and there&apos;s not a lot in between.

The hierarchy is:

EphyWindow
 AdwBreakpointBin
  AdwTabOverview
   AdwBin
    EphyFullscreenBox
     AdwToolbarView
      AdwToastOverlay
       EphyTabView
        AdwTabView
         AdwBin
          EphyEmbed
           GtkOverlay
            EphyWebView (is a WebKitWebView)

OK, so &quot;there&apos;s not a lot in between&quot; is not really true. But one of those things is handling the event before WebKit even sees it, so we can be confident it&apos;s either an Epiphany bug or a libadwaita bug, not a WebKit bug. Unfortunately I cannot find any suspicious key event controllers in Epiphany or libadwaita, so I might need to &quot;bisect&quot; my way through this hierarchy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976008</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-06 18:16:57 -0700</bug_when>
    <thetext>I bisected the widget hierarchy by creating GtkEventControllerKeys in each object&apos;s init method and hooking them up to dummy callbacks that just print when an event is received and then propagate the event. This works properly for all events except the &quot;keydown c&quot; event that is going missing. In this case, the AdwBreakpointBin never receives the key press event. This makes no sense because it&apos;s directly below the EphyWindow, which does receive the event.

We&apos;ll probably need a closer investigation inside GTK itself to figure out what is going wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976118</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-09-07 06:55:05 -0700</bug_when>
    <thetext>Moved to https://gitlab.gnome.org/GNOME/epiphany/-/issues/2173</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>