Bug 493589 - Overview effect toggles itself off and instantly back on again when set to Meta key
Summary: Overview effect toggles itself off and instantly back on again when set to Me...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-overview (show other bugs)
Version: git master
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 493650 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-24 14:22 UTC by Akseli Lahtinen
Modified: 2024-09-25 19:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akseli Lahtinen 2024-09-24 14:22:57 UTC
SUMMARY

If Overview effect is set to open and close with meta key, opening it works fine, but when trying to close it with meta key, it closes and immediately reopens.

STEPS TO REPRODUCE
1. Set overview effect to open with Meta key only
2. Open overview with meta key
3. Close overview with meta key

OBSERVED RESULT
Overview immediately reopens

EXPECTED RESULT
Overview should just close

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.90
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15,5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600

ADDITIONAL INFORMATION

In overvieweffect.cpp:355 changing the QEvent::KeyPress to QEvent::KeyRelease seems to fix the issue, since KeyPress for some reason sends event when the key is raised too.
Comment 1 Nate Graham 2024-09-24 14:37:23 UTC
Hmm, cannot reproduce with today's git master.
Comment 2 Zamundaaa 2024-09-24 23:03:58 UTC
can confirm, and I also see why it doesn't happen for Nate. The overview effect gets the keyboard shortcuts on startup, so you need to have the shortcut configured when the effect gets loaded.
Comment 3 Bug Janitor Service 2024-09-24 23:16:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6487
Comment 4 Zamundaaa 2024-09-25 12:22:34 UTC
Git commit ff2566562d413dc268d87b3c72fd56a6061a5d40 by Xaver Hugl.
Committed on 25/09/2024 at 11:57.
Pushed by zamundaaa into branch 'master'.

plugins/overview, windowview: don't handle keyboard shortcuts on Wayland

The only reason for handling them is that the effect grabs the keyboard, which disables
global shortcuts on Xorg.
In the Wayland session though, global shortcuts still work while the effects are active,
and usually that works fine, as the global shortcuts filter filters out the key press events
before they reach the effect. Modifier-only shortcuts though trigger on release, so they
don't get filtered out and the shortcut effectively gets triggered twice, once by the effect
on press, and once by kglobalacceld on release.

M  +21   -19   src/plugins/overview/overvieweffect.cpp
M  +1    -1    src/plugins/windowview/windowvieweffect.cpp

https://invent.kde.org/plasma/kwin/-/commit/ff2566562d413dc268d87b3c72fd56a6061a5d40
Comment 5 Zamundaaa 2024-09-25 19:16:49 UTC
Git commit 1654ddd270849e7c0b093324f5b094cb12d13c88 by Xaver Hugl.
Committed on 25/09/2024 at 19:05.
Pushed by zamundaaa into branch 'Plasma/6.2'.

plugins/overview, windowview: don't handle keyboard shortcuts on Wayland

The only reason for handling them is that the effect grabs the keyboard, which disables
global shortcuts on Xorg.
In the Wayland session though, global shortcuts still work while the effects are active,
and usually that works fine, as the global shortcuts filter filters out the key press events
before they reach the effect. Modifier-only shortcuts though trigger on release, so they
don't get filtered out and the shortcut effectively gets triggered twice, once by the effect
on press, and once by kglobalacceld on release.


(cherry picked from commit ff2566562d413dc268d87b3c72fd56a6061a5d40)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +21   -19   src/plugins/overview/overvieweffect.cpp
M  +1    -1    src/plugins/windowview/windowvieweffect.cpp

https://invent.kde.org/plasma/kwin/-/commit/1654ddd270849e7c0b093324f5b094cb12d13c88
Comment 6 Nate Graham 2024-09-25 19:54:28 UTC
*** Bug 493650 has been marked as a duplicate of this bug. ***