Bug 495264

Summary: Missing notification about modifier key status changes
Product: [Plasma] plasmashell Reporter: Coacher <itumaykin+kde>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: jayabbhi, kde, nate, nicolas.fella
Priority: NOR    
Version: 6.2.1   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.3
Sentry Crash Report:

Description Coacher 2024-10-23 19:29:40 UTC
STEPS TO REPRODUCE
1. Enable notifications for the modifier keys in systemsettings (Accessibility -> Modifier Keys)
2. Press modifier key, e.g. CapsLock

OBSERVED RESULT
No notification

EXPECTED RESULT
Notification is shown telling about the CapsLock status change


SOFTWARE/OS VERSIONS
$ kinfo
Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.11.4-201.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics

ADDITIONAL INFORMATION
This is a regression from Plasma-6.1 where modifier key notifications worked as expected. Other notifications also work as expected.
Comment 1 Nicolas Fella 2024-10-23 22:12:08 UTC
This works as expected for me, which is not surprising given I literally implemented support for this on Wayland for 6.2 (https://invent.kde.org/plasma/kwin/-/merge_requests/6068).

Previously it would only work if XWayland was configured to allow key eavesdropping.
Comment 2 Coacher 2024-10-24 08:00:06 UTC
(In reply to Nicolas Fella from comment #1)
> This works as expected for me, which is not surprising given I literally
> implemented support for this on Wayland for 6.2
> (https://invent.kde.org/plasma/kwin/-/merge_requests/6068).
> 
> Previously it would only work if XWayland was configured to allow key
> eavesdropping.

Hmm, it was working for me before, but stopped working in Plasma 6.2.

I've tried disabling key X11 from reading keystrokes in system settings, it didn't help.

Could it be related to https://bugs.kde.org/show_bug.cgi?id=458699#c14 ?
Comment 3 Nicolas Fella 2024-10-27 16:22:20 UTC
*** Bug 495430 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2024-10-27 16:24:50 UTC
okay, I see what's wrong. I made a mistake while handling the notification categories. It works when the "A modifier key has been locked" notification is enabled, but not with "A lock key has been activated"
Comment 5 Bug Janitor Service 2024-10-27 16:27:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6704
Comment 6 Abbhinav Jayaraman 2024-10-27 18:55:54 UTC
(In reply to Nicolas Fella from comment #4)
> okay, I see what's wrong. I made a mistake while handling the notification
> categories. It works when the "A modifier key has been locked" notification
> is enabled, but not with "A lock key has been activated"

I am confused by this comment, but I just installed Fedora 40 KDE Spin, and it seems like for any notification to work you need to have the "A modifier has been unlocked" 

Not sure if it is relevant, or if that's what you meant.
Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.11.4-201.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Acer
Product Name: Swift SFX14-41G
System Version: V1.10
Comment 7 Nicolas Fella 2024-10-28 10:09:45 UTC
> it seems like for any notification to work you need to have the "A modifier has been unlocked" 

That's what I meant
Comment 8 Nicolas Fella 2024-10-28 10:17:50 UTC
Git commit b786c7e930ed15fa3a372c8a883d872ec4050e77 by Nicolas Fella.
Committed on 28/10/2024 at 10:08.
Pushed by nicolasfella into branch 'master'.

plugins/keynotification: Fix event ID for notification

M  +1    -1    src/plugins/keynotification/keynotification.cpp

https://invent.kde.org/plasma/kwin/-/commit/b786c7e930ed15fa3a372c8a883d872ec4050e77
Comment 9 Nicolas Fella 2024-10-28 10:55:34 UTC
Git commit 1485605dbc1d7a792119dc70d131c6d47e32095f by Nicolas Fella.
Committed on 28/10/2024 at 10:20.
Pushed by vladz into branch 'Plasma/6.2'.

plugins/keynotification: Fix event ID for notification


(cherry picked from commit b786c7e930ed15fa3a372c8a883d872ec4050e77)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +1    -1    src/plugins/keynotification/keynotification.cpp

https://invent.kde.org/plasma/kwin/-/commit/1485605dbc1d7a792119dc70d131c6d47e32095f