<?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>248144</bug_id>
          
          <creation_ts>2022-11-20 07:44:27 -0800</creation_ts>
          <short_desc>[GTK4] PlatformKeyboardEvent::currentStateOfModifierKeys is not implemented</short_desc>
          <delta_ts>2023-07-11 10:18:06 -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>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>258965</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=248143</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>
          
          <blocked>210100</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alicem</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1913731</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-20 07:44:27 -0800</bug_when>
    <thetext>PlatformKeyboardEvent::getCurrentModifierState (which is renamed to PlatformKeyboardEvent::currentStateOfModifierKeys in https://github.com/WebKit/WebKit/pull/6672) has hardcoded shift/ctrl/alt/meta all to 0. In GTK 3 the code did gtk_get_current_event_state(), but that&apos;s not possible in GTK 4. I also notice that PlatformKeyboardEvent::modifiersContainCapsLock hardcodes caps lock to 0.

At least shift and caps lock both actually work when typing in this Bugzilla.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914413</commentid>
    <comment_count>1</comment_count>
    <who name="Alice Mikhaylenko">alicem</who>
    <bug_when>2022-11-23 19:14:28 -0800</bug_when>
    <thetext>The real question is why it does that instead of having modifiers as part of the event already. Like that code was never correct to begin with.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929389</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-01-30 07:23:33 -0800</bug_when>
    <thetext>(In reply to Alexander Mikhaylenko from comment #1)
&gt; The real question is why it does that instead of having modifiers as part of
&gt; the event already. Like that code was never correct to begin with.

The name of the function, PlatformKeyboardEvent::currentStateOfModifierKeys, is kinda unambiguous, though. It&apos;s asking for the *current* state of the modifier keys, not the state of modifier keys corresponding to any particular event. And it is a static function, not a method that operates on a particular event.

Looks like it&apos;s used only by DragController.cpp and EventHandler.cpp (plus some platform-specific places that don&apos;t affect GTK). In DragController it&apos;s used to synthesize mouse events, which looks pretty reasonable. In EventHandler.cpp it&apos;s again used to synthesize mouse events in EventHandler::fakeMouseMoveEventTimerFired.

So this code looks decent enough. Only problem is we need to implement it. I wonder if that&apos;s even possible with GTK 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966227</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-07-11 10:18:06 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 258965 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>