Bug 500702 - Toggling "Night Light suspend" switch with ENTER has no effect but SPACE works
Summary: Toggling "Night Light suspend" switch with ENTER has no effect but SPACE works
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Brightness and Color widget (show other bugs)
Version: 6.3.1
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-24 23:35 UTC by nilskemail+kde
Modified: 2025-02-25 10:37 UTC (History)
1 user (show)

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


Attachments
The switch being toggled with ENTER and SPACES but only some of them have an effect (622.78 KB, video/webm)
2025-02-24 23:39 UTC, nilskemail+kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nilskemail+kde 2025-02-24 23:35:06 UTC
SUMMARY
Using keyboard shortcuts to suspend/disable the night light mode does not work when pressing enter but only when pressing space

STEPS TO REPRODUCE
1. Open Brightness and Color Widget
2. Find your way to the Night Light Suspend switch with TAB
3. Toggle it using ENTER
4. Toggle it using SPACE

OBSERVED RESULT
Both key presses toggle the switch but only toggling it using SPACE results in the nightlight being suspended

EXPECTED RESULT
Both key presses should toggle the switch and suspend the night light mode

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.12.15-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon  780M Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: AMD Radeon 780M
Comment 1 nilskemail+kde 2025-02-24 23:39:17 UTC
Created attachment 178850 [details]
The switch being toggled with ENTER and SPACES but only some of them have an effect
Comment 2 Bug Janitor Service 2025-02-25 09:18:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/524
Comment 3 cwo 2025-02-25 10:05:54 UTC
Git commit 611699d9aae7061b96e306370728271277334de5 by Christoph Wolk.
Committed on 25/02/2025 at 10:01.
Pushed by cwo into branch 'master'.

applets/brightness: fix Return press on switch

The "Suspend" switch for Night Light calls toggle() on space/enter/
return press, and handles the onToggled() signal to actually perform the
action. The qqc2 api is exceptionally confusing here, toggle() refers to
changing the checked state of a button, but does not automatically
call toggled() which is called when a user interactively manipulates a
control, and would need to be called explicitly in the handler. The only
reason it worked for Space is that the event wasn't accepted, so the
switch called toggled() internally.

Instead, just use clicked() and avoid the whole messy toggled/toggle()
situation. Along the way, we also explicitly accept the onPressed events
when we handle them, to avoid problems with multiple activation in the
future.
FIXED-IN: 6.3.2

M  +5    -3    applets/brightness/package/contents/ui/NightLightItem.qml

https://invent.kde.org/plasma/powerdevil/-/commit/611699d9aae7061b96e306370728271277334de5
Comment 4 cwo 2025-02-25 10:37:55 UTC
Git commit 2ac969859626964802cf63300baec54f036f9425 by Christoph Wolk.
Committed on 25/02/2025 at 10:35.
Pushed by cwo into branch 'Plasma/6.3'.

applets/brightness: fix Return press on switch

The "Suspend" switch for Night Light calls toggle() on space/enter/
return press, and handles the onToggled() signal to actually perform the
action. The qqc2 api is exceptionally confusing here, toggle() refers to
changing the checked state of a button, but does not automatically
call toggled() which is called when a user interactively manipulates a
control, and would need to be called explicitly in the handler. The only
reason it worked for Space is that the event wasn't accepted, so the
switch called toggled() internally.

Instead, just use clicked() and avoid the whole messy toggled/toggle()
situation. Along the way, we also explicitly accept the onPressed events
when we handle them, to avoid problems with multiple activation in the
future.
FIXED-IN: 6.3.2

M  +5    -3    applets/brightness/package/contents/ui/NightLightItem.qml

https://invent.kde.org/plasma/powerdevil/-/commit/2ac969859626964802cf63300baec54f036f9425