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 721173 - alt + shutdown button alternative for suspend
alt + shutdown button alternative for suspend
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: system-status
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-28 22:48 UTC by Sri Ramkrishna
Modified: 2017-02-16 00:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
system: Switch between alternatives on long-press (3.10 KB, patch)
2016-05-26 22:44 UTC, Florian Müllner
committed Details | Review

Description Sri Ramkrishna 2013-12-28 22:48:45 UTC
I'd like to revisit this design for this.  The alt button + hitting the power button to get suspend is very clunky when you are connected to a laptop with the lid closed and connected to an external monitor.

In this set up, the assumption that you are on a desktop is wrong.  At work, I come into work, with the laptop in suspend.  Unfortunately, we do not have a wake on external keyboard keypress to wake up, instead I have to connect all cords, then flip up the lid and then when the monitor powers up, flip the lid down again.

As a manager, I have to attend meetings and thus suspending from an external monitor happens a lot and then replugging also comes a lot.  I don't think this is uncommon for a lot of office workers especially managers like myself.  The work around is of course to keep the lid up, but design should really take this into account.

One possible design change could be to use a long press on the power button to get the suspend action.  This maintains the visual design while still giving you an option to hit the button.  You could of course put the suspend button as well.  Or you can revisit the default.  If you are able to detect a laptop/mobile device perhaps you can come up with a better default choice than just shutdown.  I know that feedback has shown that a lot of people do in fact shutdown on their laptops.  It's not a smart idea as I think that causes more wear and tear on your laptop.

In any case, I look forward to a discussion on this.
Comment 1 Miguel Vaello Martínez 2015-12-22 00:06:56 UTC
Yesterday I was talking about this usability issue with Florian Müllner and some others. We think that could be a good thing to implement the "long press" mode for suspend the machine. 

This problem affects not only to desktop/laptop devices, other portable devices, like tablets, have no "alt" key to press and have no sense to use the on screen keyboard and press the "alt" key and then the power button at same time.
Comment 2 Matthias Clasen 2015-12-22 15:28:13 UTC
the onscreen keyboard has no alt key either...
Comment 3 Florian Müllner 2016-05-26 22:44:24 UTC
Created attachment 328603 [details] [review]
system: Switch between alternatives on long-press

On systems that support both shutdown and suspend, the latter operation
is currently only accessible via pressing the Alt key. As using the
keyboard may be inconvenient or simply not possible (e.g. on touch),
allow switching between alternatives via long-press as well.
Comment 4 Rui Matos 2016-05-27 14:07:12 UTC
Review of attachment 328603 [details] [review]:

Some comments below but nothing worth holding this up, feel free to ignore them

::: js/ui/status/system.js
@@ +57,3 @@
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+        this.actor.connect('notify::mapped',
+                           Lang.bind(this, () => this._flipped = false));

I'll note this is the first time we're introducing the arrow function syntax. IIUC, Lang.bind() shouldn't be needed as binding 'this' is one of the features of this syntax. Also, not using {} after the arrow means we're returning the value which is pointless in this case.

@@ +67,3 @@
             let altPressed = (mods & Clutter.ModifierType.MOD1_MASK) != 0;
+            if (this._flipped)
+                childToShow = altPressed ? this._standard : this._alternate;

I'd just logically OR _flipped with altPressed but no big deal

@@ +83,3 @@
+                childShown.remove_action(this._clickAction);
+            }
+            childToShow.add_action(this._clickAction);

It'd be cleaner, and this dance wouldn't be needed, if this.actor was the St.Button and the alternating children were just the icons
Comment 5 Florian Müllner 2016-05-27 14:56:33 UTC
(In reply to Rui Matos from comment #4)
> @@ +67,3 @@
>              let altPressed = (mods & Clutter.ModifierType.MOD1_MASK) != 0;
> +            if (this._flipped)
> +                childToShow = altPressed ? this._standard : this._alternate;
> 
> I'd just logically OR _flipped with altPressed but no big deal

I did that originally, but OR isn't quite correct. I guess I could use

  childToShow = (altPressed != this._flipped) ? this._alternate : this._standard;

but it's not immediately obvious that this equates to XOR (which is what we want IMHO - pressing Alt after flipping should still have an effect)

 
> @@ +83,3 @@
> +                childShown.remove_action(this._clickAction);
> +            }
> +            childToShow.add_action(this._clickAction);
> 
> It'd be cleaner, and this dance wouldn't be needed, if this.actor was the
> St.Button and the alternating children were just the icons

True, but then we'd need a different dance to "click"/activate the children.
Comment 6 Florian Müllner 2017-02-16 00:39:35 UTC
Attachment 328603 [details] pushed as 2c070d3 - system: Switch between alternatives on long-press