GNOME Bugzilla – Bug 721173
alt + shutdown button alternative for suspend
Last modified: 2017-02-16 00:39:40 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.
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.
the onscreen keyboard has no alt key either...
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.
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
(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.
Attachment 328603 [details] pushed as 2c070d3 - system: Switch between alternatives on long-press