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

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>464805</bug_id>
          
          <creation_ts>2023-01-25 15:48:14 +0000</creation_ts>
          <short_desc>Modifier only shortcuts assigned through system settings-shortcuts trigger on &quot;press&quot; action instead of &quot;release&quot;</short_desc>
          <delta_ts>2024-08-03 01:24:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kglobalaccel</product>
          <component>general</component>
          <version>5.249.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=452113</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=470113</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=470257</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=470256</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=420493</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=481373</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dmitrii Chermnykh">chermnykh2001</reporter>
          <assigned_to>fanzhuyifan</assigned_to>
          <cc>bugseforuns</cc>
    
    <cc>butirsky</cc>
    
    <cc>chermnykh2001</cc>
    
    <cc>fanzhuyifan</cc>
    
    <cc>ilia.karpov.96</cc>
    
    <cc>kde</cc>
    
    <cc>kde</cc>
    
    <cc>madLyfe</cc>
    
    <cc>nate</cc>
    
    <cc>oded</cc>
    
    <cc>tietininon</cc>
    
    <cc>xalt7x.service</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kglobalacceld/-/commit/d20d58d4729fd94b3373b803de89054c2e2550de</cf_commitlink>
          <cf_versionfixedin>6.1</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2201818</commentid>
    <comment_count>0</comment_count>
    <who name="Dmitrii Chermnykh">chermnykh2001</who>
    <bug_when>2023-01-25 15:48:14 +0000</bug_when>
    <thetext>SUMMARY
Modifier only shortcuts on X11 trigger on &quot;press&quot; action instead of &quot;release&quot;. This results in triggering multiple shortcuts when pressing a shortcut with modifier. 


STEPS TO REPRODUCE
1. Bind a shortcut to a modifier (for example &quot;super/meta&quot; key for krunner)
2. Bind meta+space to another shortcut (in my case it triggers keyboard layout switch via fcitx5)
3. Press meta+space

OBSERVED RESULT
Both shortcuts got triggered (keyboard layout switch + krunner)

EXPECTED RESULT
Only meta+space shortcut triggers (keyboard layout switch)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Xorg 21.1.6-1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2201899</commentid>
    <comment_count>1</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2023-01-25 18:07:11 +0000</bug_when>
    <thetext>Works for me on Wayland FWIW.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2201950</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2023-01-25 21:00:33 +0000</bug_when>
    <thetext>possibly duplicate of bug 452113</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2201960</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2023-01-25 21:23:16 +0000</bug_when>
    <thetext>Hmm, maybe the have the same root cause? Needs investigation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2227926</commentid>
    <comment_count>4</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2023-05-04 08:40:59 +0000</bug_when>
    <thetext>There are two paths for modifier only shortcuts:

 - kwin did a path of modifier shortcuts, which was release only 

 - in kglobalaccel a modifier only shortcut will fire on press, like another shortcut.

It&apos;s slightly more complex as that kglobalaccel usage was designed to cover press-to-talk like cases. Those can&apos;t be delayed. It will need to be a flag on shortcut bind or done exclusively client side</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2233087</commentid>
    <comment_count>5</comment_count>
    <who name="Oded Arbel">oded</who>
    <bug_when>2023-05-25 13:40:40 +0000</bug_when>
    <thetext>I can reproduce this issue in Plasma 6 on Wayland:

When setting a modifier only shortcut, it triggers on key press. If the same modifier is used in another shortcut (for example CTRL vs CTRL+S) than both events are being triggered, though if the modifier-only shortcut is quick enough to grab focus away from the application that is supposed to handle the second shortcut, then it might not happen at all.

For example:

STEPS TO REPRODUCE:
1. In the keyboard shortcut settings, find Krunner and add to it a shortcut of &quot;Control&quot;.
2. Start another application that can &quot;save&quot; on CTRL+S - for example, Firefox.
3. Press CTRL+S

OBSERVED RESULT
Krunner appears.

EXPECTED RESULT
The &quot;Save&quot; dialog should come up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2233088</commentid>
    <comment_count>6</comment_count>
    <who name="Andrey">butirsky</who>
    <bug_when>2023-05-25 13:47:10 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #1)
&gt; Works for me on Wayland FWIW.

What was your test Nate? Can you confirm the fail above?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2233499</commentid>
    <comment_count>7</comment_count>
    <who name="Oded Arbel">oded</who>
    <bug_when>2023-05-28 10:50:48 +0000</bug_when>
    <thetext>(In reply to Oded Arbel from comment #5)
&gt; I can reproduce this issue in Plasma 6 on Wayland:
&gt; ...
&gt; STEPS TO REPRODUCE:
&gt; 1. In the keyboard shortcut settings, find Krunner and add to it a shortcut
&gt; of &quot;Control&quot;.
&gt; 2. Start another application that can &quot;save&quot; on CTRL+S - for example,
&gt; Firefox.
&gt; 3. Press CTRL+S

Setting up modifier-only shortcuts using kwinrc ([ModifierOnlyShortcuts] section), instead of using the System Settings shortcuts KCM, the modifier-only shortcut does trigger correctly on release.

I&apos;m not sure what the KCM is doing that is different than setting the kwinrc setting, but there are obviously two different systems that pertain to do the same thing, where one of them is doing it wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2281129</commentid>
    <comment_count>8</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2024-01-17 15:54:34 +0000</bug_when>
    <thetext>*** Bug 479807 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2289115</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitrii Chermnykh">chermnykh2001</who>
    <bug_when>2024-02-15 20:19:07 +0000</bug_when>
    <thetext>*** Bug 481373 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2289125</commentid>
    <comment_count>10</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-02-15 20:54:18 +0000</bug_when>
    <thetext>Moved to kglobalaccel since the modifier-only shortcuts handled by kwin activate on release, and this is about regular shortcuts handled by a different code path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2289128</commentid>
    <comment_count>11</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-02-15 20:57:34 +0000</bug_when>
    <thetext>Also just a heads-up that I plan to take a look at this some time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2290420</commentid>
    <comment_count>12</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-02-20 16:31:52 +0000</bug_when>
    <thetext>https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/44</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2303449</commentid>
    <comment_count>13</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-03-20 17:02:06 +0000</bug_when>
    <thetext>Git commit d20d58d4729fd94b3373b803de89054c2e2550de by Yifan Zhu.
Committed on 20/03/2024 at 17:00.
Pushed by fanzhuyifan into branch &apos;master&apos;.

Enhance modifier-only shortcuts

Trigger modifier-only shortcuts trigger on release, and support multi-key
modifier-only shortcuts, which trigger only when all the modifiers are
released within some interval.
Related: bug 470256

M  +50   -19   src/globalshortcutsregistry.cpp
M  +15   -0    src/globalshortcutsregistry.h
M  +38   -1    src/sequencehelpers_p.cpp
M  +2    -0    src/sequencehelpers_p.h

https://invent.kde.org/plasma/kglobalacceld/-/commit/d20d58d4729fd94b3373b803de89054c2e2550de</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2342302</commentid>
    <comment_count>14</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-08-01 20:20:20 +0000</bug_when>
    <thetext>*** Bug 474024 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2342685</commentid>
    <comment_count>15</comment_count>
    <who name="">fanzhuyifan</who>
    <bug_when>2024-08-03 01:24:02 +0000</bug_when>
    <thetext>*** Bug 467341 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>