After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746980 - media-keys: invert in_lock_screen logic and give it a better name
media-keys: invert in_lock_screen logic and give it a better name
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: media-keys
3.16.x
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-29 19:58 UTC by Clément Guérin
Modified: 2015-04-01 21:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
media-keys: invert in_lock_screen logic and give it a better name (2.21 KB, patch)
2015-03-29 19:58 UTC, Clément Guérin
needs-work Details | Review
media-keys: Fix logic error when handling power keys (2.41 KB, patch)
2015-04-01 09:37 UTC, Bastien Nocera
committed Details | Review

Description Clément Guérin 2015-03-29 19:58:17 UTC
Commit 8d417087fce83 inverted the logic in do_action(). In my case it
broke the interactive menu when pressing the power key. Follow power_action()
naming convention for the parameter name.
Comment 1 Clément Guérin 2015-03-29 19:58:21 UTC
Created attachment 300546 [details] [review]
media-keys: invert in_lock_screen logic and give it a better name
Comment 2 Bastien Nocera 2015-04-01 09:30:57 UTC
Review of attachment 300546 [details] [review]:

Sure, well spotted!
Comment 3 Bastien Nocera 2015-04-01 09:32:44 UTC
Review of attachment 300546 [details] [review]:

Actually, this code already existed in 3.14 (and probably earlier).

I'll rework the patch.
Comment 4 Bastien Nocera 2015-04-01 09:37:48 UTC
Created attachment 300729 [details] [review]
media-keys: Fix logic error when handling power keys

In the lock screen, means non-interactive action:
in_lock_screen == !power_action_interactive

Rename the variable to avoid having to invert it twice.

Spotted by Clément Guérin <geecko.dev@free.fr>
Comment 5 Bastien Nocera 2015-04-01 09:38:17 UTC
Attachment 300729 [details] pushed as a733ec3 - media-keys: Fix logic error when handling power keys
Comment 6 Clément Guérin 2015-04-01 18:08:48 UTC
I'm not sure if your approach is better, anyway, thanks for merging it! :)
Comment 7 Bastien Nocera 2015-04-01 21:15:06 UTC
(In reply to Clément Guérin from comment #6)
> I'm not sure if your approach is better, anyway, thanks for merging it! :)

It avoids changes to do_power_action() which means we can cherry-pick, and it's not that much uglier ;)