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 743456 - power: When locking the screen on tablets, also suspend
power: When locking the screen on tablets, also suspend
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: media-keys
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-25 00:19 UTC by Bastien Nocera
Modified: 2017-02-27 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: When locking the screen on tablets, also suspend (5.12 KB, patch)
2015-01-25 00:19 UTC, Bastien Nocera
none Details | Review
power: When disabling the backlight, also suspend on tablets (4.82 KB, patch)
2015-01-25 07:25 UTC, Bastien Nocera
none Details | Review
daemon: Add chassis type helper (3.25 KB, patch)
2015-01-27 18:22 UTC, Bastien Nocera
needs-work Details | Review
power: When disabling the backlight, also suspend on tablets (3.07 KB, patch)
2015-01-27 18:22 UTC, Bastien Nocera
committed Details | Review
rfkill: Use new chassis type helper (4.66 KB, patch)
2015-01-27 18:22 UTC, Bastien Nocera
committed Details | Review
daemon: Add chassis type helper (3.28 KB, patch)
2015-01-27 22:18 UTC, Bastien Nocera
committed Details | Review
power: Fix a small memory leak (837 bytes, patch)
2015-01-27 22:19 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2015-01-25 00:19:45 UTC
.
Comment 1 Bastien Nocera 2015-01-25 00:19:49 UTC
Created attachment 295350 [details] [review]
power: When locking the screen on tablets, also suspend

See https://bugzilla.gnome.org/show_bug.cgi?id=743455 for
details the full reasoning.
Comment 2 Bastien Nocera 2015-01-25 07:25:12 UTC
Created attachment 295356 [details] [review]
power: When disabling the backlight, also suspend on tablets

See https://bugzilla.gnome.org/show_bug.cgi?id=743455 for
details the full reasoning.
Comment 3 Bastien Nocera 2015-01-25 07:25:45 UTC
Comment on attachment 295350 [details] [review]
power: When locking the screen on tablets, also suspend

This, smaller, new patch should be enough.
Comment 4 Cosimo Cecchi 2015-01-27 10:35:44 UTC
Review of attachment 295356 [details] [review]:

::: plugins/power/gpm-common.c
@@ +193,3 @@
 
+gboolean
+gsd_power_is_hardware_a_tablet (void)

It would be nice to share this code with the similar one in GsdRfkillManager that fetches the chassis type.
Comment 5 Bastien Nocera 2015-01-27 18:22:34 UTC
Created attachment 295565 [details] [review]
daemon: Add chassis type helper
Comment 6 Bastien Nocera 2015-01-27 18:22:40 UTC
Created attachment 295566 [details] [review]
power: When disabling the backlight, also suspend on tablets

See https://bugzilla.gnome.org/show_bug.cgi?id=743455 for
details the full reasoning.
Comment 7 Bastien Nocera 2015-01-27 18:22:46 UTC
Created attachment 295567 [details] [review]
rfkill: Use new chassis type helper
Comment 8 Cosimo Cecchi 2015-01-27 19:31:08 UTC
Review of attachment 295565 [details] [review]:

::: gnome-settings-daemon/gnome-settings-bus.c
@@ +160,3 @@
+        }
+
+        variant = g_dbus_connection_call_sync (connection,

Should g_variant_unref(inner) after this
Comment 9 Cosimo Cecchi 2015-01-27 19:31:45 UTC
Review of attachment 295566 [details] [review]:

Looks good to me
Comment 10 Cosimo Cecchi 2015-01-27 19:32:15 UTC
Review of attachment 295567 [details] [review]:

Looks good
Comment 11 Bastien Nocera 2015-01-27 22:18:51 UTC
Created attachment 295601 [details] [review]
daemon: Add chassis type helper
Comment 12 Bastien Nocera 2015-01-27 22:19:02 UTC
Created attachment 295602 [details] [review]
power: Fix a small memory leak

Don't forget to unref the left-over variant.
Comment 13 Cosimo Cecchi 2015-01-28 10:16:15 UTC
Review of attachment 295601 [details] [review]:

Looks good
Comment 14 Cosimo Cecchi 2015-01-28 10:16:34 UTC
Review of attachment 295602 [details] [review]:

Sure
Comment 15 Bastien Nocera 2015-01-28 10:39:07 UTC
Attachment 295566 [details] pushed as 983c54c - power: When disabling the backlight, also suspend on tablets
Attachment 295567 [details] pushed as 0698928 - rfkill: Use new chassis type helper
Attachment 295601 [details] pushed as 4092695 - daemon: Add chassis type helper
Attachment 295602 [details] pushed as a9e92f0 - power: Fix a small memory leak
Comment 16 Benjamin Kreuter 2016-04-07 02:52:43 UTC
Please make this a configurable option!  This feature has caused me a great deal of annoyance with my "convertible" laptop/tablet, which I generally use as a laptop.  I am not the only one who has been annoyed by this:

https://ask.fedoraproject.org/en/question/76767/unwanted-suspend-when-locking-screen-using-gnome/

This is behavior might make sense on some devices, but it should not be hard-coded.
Comment 17 Bastien Nocera 2016-04-07 08:52:20 UTC
(In reply to Benjamin Kreuter from comment #16)
> Please make this a configurable option!  This feature has caused me a great
> deal of annoyance with my "convertible" laptop/tablet, which I generally use
> as a laptop.  I am not the only one who has been annoyed by this:
> 
> https://ask.fedoraproject.org/en/question/76767/unwanted-suspend-when-
> locking-screen-using-gnome/
> 
> This is behavior might make sense on some devices, but it should not be
> hard-coded.

If you machine suspends, that means it advertises itself as a tablet. Read "man machine-info" and change the chassis type to match the actual type then.
Comment 18 Benjamin Kreuter 2016-04-07 12:23:10 UTC
Changing the chassis type to 'laptop' does work -- but then the machine suspends whenever I switch between laptop and tablet mode, which is less annoying but which is still annoying.  I am also hesitant to rely on manually setting the chassis type as anything more than a temporary workaround, since the problem is not the chassis type ('laptop' is not any more correct than 'tablet' for this machine).
Comment 19 Bastien Nocera 2016-04-07 12:25:07 UTC
Then file a new bug, this code has already been shipped in 3 stable releases, there's no cause to reopen this one.
Comment 20 Jani Nikula 2017-02-27 09:36:26 UTC
(In reply to Bastien Nocera from comment #19)
> Then file a new bug, this code has already been shipped in 3 stable
> releases, there's no cause to reopen this one.

For the benefit of others ending up here: see bug 764723 and bug 779300.