Project

General

Profile

Bug #8302

Shutdown helper applet in Jessie

Added by anonym over 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Elevated
Assignee:
-
Category:
-
Target version:
Start date:
11/26/2014
Due date:
10/15/2015
% Done:

100%

Feature Branch:
feature/jessie
Type of work:
Code
Blueprint:
Starter:
Affected tool:

Description

In Jessie we use GNOME Shell, which doesn't handle status area icons like in GNOME 2.x. We use the topIcons GNOME Shell extension to re-enable such status area icons, e.g. for gpgApplet and Vidalia, but for some reason the shutdown helper doesn't show up.

Even if we could get it to work with topIcons, it's probably not a good idea. The GNOME user menu already has a shutdown icon in it, and it'd be more elegant to integrate it there, most likely by writing some simple GNOME Shell extension.

gnome-shell-extension-shutdown-helper-0.1.tar.gz (2.14 KB) anonym, 11/25/2014 01:48 PM

shutdown-helper.png View (15.9 KB) anonym, 11/26/2014 09:02 AM


Subtasks

Feature #8314: Jessie: integrate shutdown-helper extension with our translation systemResolved

Feature #8315: Import existing translations of shutdown-helper extensionRejected

Bug #8316: Should not display a Lock button unless a password was setResolved

Bug #10173: Make shutdown-helper in Jessie compatible with OrcaResolved

Associated revisions

Revision e55f05d8 (diff)
Added by Tails developers over 4 years ago

Install and enable our custom shutdown-helper GNOME Shell extension (Closes: #8302, #5684 and #5878).

It adds a Lock Screen and Restart button to the GNOME user menu,
removes the press-Alt-to-turn-shutdown-button-into-Suspend
functionality, and makes Restart and Shutdown immediate, without
further user interaction.

It's based on laserb's gnome-shell-extension-suspend-button:
https://github.com/laserb/gnome-shell-extension-suspend-button

History

#1 Updated by anonym over 4 years ago

I propose the following:

Goal: In the GNOME user menu, show both a "Restart" and "Power Off" button, instead of only the "Power Off" button (which switches to "Suspend" when Alt is pressed). When one of these are pressed, the reboot/shutdown action happens without further user intervention, i.e. there's no prompt.

This can be achieved quite easily by basing our work on https://github.com/laserb/gnome-shell-extension-suspend-button. What it does is that it splits the "Power Off"/"Suspend" button into two separate buttons (so the Alt-switching described above is removed). We essentially will just have to s/Suspend/Restart/ to get the functionality we want, but it would be a good for maintainability to rip out everything we don't need as well.

Bonus: it's packaged in Debian so we can make it into a separate package quite easily: git://anonscm.debian.org/collab-maint/gnome-shell-extension-suspend-button.git

Also, I've noticed that GNOME Shell behaves sane with screen locking; if I run gnome-screensaver-command --lock with a password set, the screen is locked and a password is required to unlock, but when a password is not set, none is required. Adding a separate "Lock Screen" button should be simple. The we don't have to worry about the current state of #5878 as we get what we want for free.

#2 Updated by anonym over 4 years ago

See attached file for an implementation of comment 1. To test it in a running Jessie-based Tails with an admin password set, untar it into /usr/share/gnome-shell/extensions (and make sure the ownership/permissions are good), and then enable the "Shutdown Helper" extension with gnome-shell-extension-prefs. You may have to restart GNOME (systemctl restart gdm3) to make it apply the first time, but after that it can be enabled/disabled at will.

#3 Updated by anonym over 4 years ago

anonym wrote:

Also, I've noticed that GNOME Shell behaves sane with screen locking; if I run gnome-screensaver-command --lock with a password set, the screen is locked and a password is required to unlock, but when a password is not set, none is required.

For this to work, it seems we have to passwd -d amnesia, which we can add to Tails Greeter's PostLogin script, where we handle the case where no password is set.

#4 Updated by intrigeri over 4 years ago

Bonus: it's packaged in Debian so we can make it into a separate package quite easily:
git://anonscm.debian.org/collab-maint/gnome-shell-extension-suspend-button.git

I don't get what you mean with "make it into a separate package", nor why you're attaching a tarball. Can't we just install the package from Jessie?

#5 Updated by intrigeri over 4 years ago

I propose the following:

I like this plan!

#6 Updated by anonym over 4 years ago

  • Subject changed from Emergency shutdown helper applet in Jessie to Shutdown helper applet in Jessie
  • Description updated (diff)

#7 Updated by anonym over 4 years ago

intrigeri wrote:

Bonus: it's packaged in Debian so we can make it into a separate package quite easily:
git://anonscm.debian.org/collab-maint/gnome-shell-extension-suspend-button.git

I don't get what you mean with "make it into a separate package", nor why you're attaching a tarball. Can't we just install the package from Jessie?

I suggested that we fork gnome-shell-extension-suspend-button since its plumbing is similar to what we want, so it's a good base for the extension we actually want. To be clear: gnome-shell-extension-suspend-button does not do what we want at all.

The attached tarball, and the instructions can be used to test how this will actually look and work. I thought that would be helpful for making a decision on whether we want this. Any way, I'll attach a screen shot instead.

What I meant with the "bonus" remark was simply that since it's already packaged for Debian, so we don't have to make the packaging from scratch, we can just adapt the existing one. OTOH, the packaging is setup to track an upstream, but we probably want it to be native, so I suppose the adaption won't be completely trivial (although still easy).

The (even easier) alternative would be to just dump the extension straight into Tails' Git repo, like you did with topIcons. It may not be so bad of an idea since this now is a completely divergent fork, so we won't be frequently pulling anything from gnome-shell-extension-suspend-button. What do you think?

Sorry if I was unclear.

I propose the following:

I like this plan!

I'll proceed then after I've gotten your opinion on how to install this extension.

#8 Updated by anonym over 4 years ago

#9 Updated by intrigeri over 4 years ago

OK, got it. Thanks for clarifying!

Before diving into the "how to maintain a fork" topic, just a sanity check: why not add the options we need to the existing extension, so that we don't have to maintain it ourselves forever?

The (even easier) alternative would be to just dump the extension straight into Tails' Git repo, like you did with topIcons. It may not be so bad of an idea since this now is a completely divergent fork, so we won't be frequently pulling anything from gnome-shell-extension-suspend-button. What do you think?

Agreed, this is acceptable too. We'll have to be careful about potential future updates of gnome-shell-extension-suspend-button in Jessie, but tracking this should be cheaper than maintaining a Debian package. And I doubt anyone would really be benefiting from a proper Debian package anyway.

#10 Updated by intrigeri over 4 years ago

  • Assignee set to anonym
  • Type of work changed from Research to Code

#11 Updated by anonym over 4 years ago

  • Assignee deleted (anonym)
  • Type of work changed from Code to Research

intrigeri wrote:

Before diving into the "how to maintain a fork" topic, just a sanity check: why not add the options we need to the existing extension, so that we don't have to maintain it ourselves forever?

I simply doubt that the maintainer would be interested. I think the background of this extension is the following: In GNOME 3.10 (I think) the GNOME devs made it impossible to suspend without pressing Alt, which then transforms the Shutdown button to the Suspend button. Some people run GNOME from tablets that do not have an Alt key (except via the on-screen keyboard, which is inconvenient) or just find it utterly retarded and unintuitive design (me included). I believe gnome-shell-extension-suspend-button was created for fixing this, and nothing else.

What we'd need upstreamed is the following:

  • An option to show a Lock Screen button
  • An option to show a Restart button
  • An option to not show the "Suspend" button
  • Options to change the manner of how Shutdown/Restart is initiated. We don't want to use GNOME's controlled way, since it shows a verification promp, and may be inhibited by a number of things (root application running, tty login, etc.). While the verification prompt can be suppressed with dconf's /org/gnome/gnome-session/logout-prompt, the inhibition cannot AFAICT, so we want to run sudo -n reboot/halt or similar.

All this will add a lot of complexity for things that goes outside of the extension's original purpose (the -suspend-button part), and which are likely irrelevant for most GNOME users.

The (even easier) alternative would be to just dump the extension straight into Tails' Git repo, like you did with topIcons. It may not be so bad of an idea since this now is a completely divergent fork, so we won't be frequently pulling anything from gnome-shell-extension-suspend-button. What do you think?

Agreed, this is acceptable too. We'll have to be careful about potential future updates of gnome-shell-extension-suspend-button in Jessie, but tracking this should be cheaper than maintaining a Debian paccompletely divergent forkage. And I doubt anyone would really be benefiting from a proper Debian package anyway.

Right. I sort of doubt we will ever have to pull anything from gnome-shell-extension-suspend-button any more. I ripped out all code that isn't relevant to us, so it's effectively a different extension.

So, given my explanation above, do we agree that this is the way to go?

#12 Updated by anonym over 4 years ago

  • Assignee set to anonym
  • Type of work changed from Research to Code

#13 Updated by intrigeri over 4 years ago

I simply doubt that the maintainer would be interested.

I'm now convinced. Go, go, go :)

We don't want to use GNOME's controlled way, since it shows a verification promp, and may be inhibited by a number of things (root application running, tty login, etc.). While the verification prompt can be suppressed with dconf's /org/gnome/gnome-session/logout-prompt, the inhibition cannot AFAICT, so we want to run sudo -n reboot/halt or similar.

Is that still the case on Jessie? I've not seen such inhibition messages for months on my sid desktop (while I previously did).

#14 Updated by anonym over 4 years ago

intrigeri wrote:

We don't want to use GNOME's controlled way, since it shows a verification promp, and may be inhibited by a number of things (root application running, tty login, etc.). While the verification prompt can be suppressed with dconf's /org/gnome/gnome-session/logout-prompt, the inhibition cannot AFAICT, so we want to run sudo -n reboot/halt or similar.

Is that still the case on Jessie? I've not seen such inhibition messages for months on my sid desktop (while I previously did).

Hmm. It seems it doesn't any more for root-run applications like synaptic, but it does for tty logins. That shouldn't happen often, but I see no reason why sudo -n reboot/halt would be worse.

#15 Updated by anonym over 4 years ago

  • Status changed from Confirmed to Resolved
  • Assignee deleted (anonym)
  • Feature Branch set to feature/jessie

Fixed in commit 814d2b0. This also closes #5684 and #5878 but only when feature/jessie is merged.

#16 Updated by intrigeri over 4 years ago

  • Status changed from Resolved to In Progress
  • Assignee set to anonym
  • % Done changed from 0 to 60

Reviewing, finding small issues, will file subtasks.

#17 Updated by anonym over 4 years ago

  • Status changed from In Progress to Resolved
  • Assignee deleted (anonym)

#18 Updated by intrigeri over 4 years ago

  • Status changed from Resolved to In Progress
  • Assignee set to anonym

#19 Updated by BitingBird over 4 years ago

  • Related to Bug #8372: Shutdown/reboot broken in Jessie added

#20 Updated by intrigeri over 4 years ago

  • Related to deleted (Bug #8372: Shutdown/reboot broken in Jessie)

#21 Updated by intrigeri almost 4 years ago

  • Target version changed from Tails_2.0 to Tails_1.6

#24 Updated by anonym almost 4 years ago

With all child tickets closed now, I think we're done.

#25 Updated by anonym almost 4 years ago

Hmm. Well, child #8314 (Jessie: integrate shutdown-helper extension with our translation system) is blocked by #8371 (Incomplete screen reader support in Jessie) so perhaps I was wrong to close it. OTOH, I think the blocker is incorrect. The translation system is integrated, and that Orca cannot read the "hidden" button labels is a separate, issue.

#26 Updated by anonym almost 4 years ago

So please let me know if you actually think that #10173 should be a child/blocking. I'm not sure I think so, since not even the default GNOME combined shutdown/suspend/etc button is compatible with Orca.

#27 Updated by intrigeri almost 4 years ago

So please let me know if you actually think that #10173 should be a child/blocking. I'm not sure I think so, since not even the default GNOME combined shutdown/suspend/etc button is compatible with Orca.

The main question here is whether the current state on feature/jessie brings a usability regression compared to current Tails/Wheezy. If it does, then #10173 is a blocker. It seems that there's no clear-cut answer to this:

  • On current Tails/Wheezy, if I start Orca, click on the power button (top-right), and move my mouse down a bit, then the highlighted menu entry is read by Orca (exactly as displayed on screen). Same if I navigate that menu with the keyboard. But one has to already know that one should click at the top-right of the screen first, because there's no audio feedback when the mouse is over that power button.
  • On current Tails/Jessie, if I start Orca and open the top-right GNOME menu, and then navigate with the keyboard, then our custom reboot/shutdown buttons are read by Orca (with the "push button" suffix, though), which is quite good. But mouse navigation is not possible with Orca in that menu. Given it's layout, I guess it's fully expected that if one needs a screen reader, then one must navigate this menu with the keyboard.

So we have a real regression for mouse navigation, but OTOH keyboard navigation seems to be good enough. I suggest we try to patch our extension so that the "push button" suffix is not added -- don't spend more than 20 minutes on that. And then, regardless of the outcome, we can call the current state good enough and close this ticket.

#28 Updated by anonym almost 4 years ago

  • Assignee changed from anonym to intrigeri
  • QA Check set to Info Needed

intrigeri wrote:

So please let me know if you actually think that #10173 should be a child/blocking. I'm not sure I think so, since not even the default GNOME combined shutdown/suspend/etc button is compatible with Orca.

The main question here is whether the current state on feature/jessie brings a usability regression compared to current Tails/Wheezy. If it does, then #10173 is a blocker. It seems that there's no clear-cut answer to this:

  • On current Tails/Wheezy, if I start Orca, click on the power button (top-right), and move my mouse down a bit, then the highlighted menu entry is read by Orca (exactly as displayed on screen). Same if I navigate that menu with the keyboard. But one has to already know that one should click at the top-right of the screen first, because there's no audio feedback when the mouse is over that power button.
  • On current Tails/Jessie, if I start Orca and open the top-right GNOME menu, and then navigate with the keyboard, then our custom reboot/shutdown buttons are read by Orca (with the "push button" suffix, though), which is quite good. But mouse navigation is not possible with Orca in that menu. Given it's layout, I guess it's fully expected that if one needs a screen reader, then one must navigate this menu with the keyboard.

I was unaware of keyboard navigation. Ok, then the situation isn't so bad.

So we have a real regression for mouse navigation,

I sort of fixed it in:

01f67bf Trigger accessibility events for Restart/Power Off on mouse hover.

It's a bit clunky. Please give it a try and tell me what you think. We might want to revert this given how the key focus stays, so there can be two seemingly selected elements at the same time (one of the buttons via keys, one via the mouse).

but OTOH keyboard navigation seems to be good enough. I suggest we try to patch our extension so that the "push button" suffix is not added -- don't spend more than 20 minutes on that. And then, regardless of the outcome, we can call the current state good enough and close this ticket.

Fixed in

eab3a6e Simplify accessibility notification for Restart/Power Off.

#29 Updated by intrigeri almost 4 years ago

  • Assignee changed from intrigeri to anonym

So we have a real regression for mouse navigation,

I sort of fixed it in:

Yes, "sort of": sending accessibility events may be useful, but it doesn't make the GUI discoverable with the mouse only given the complex layout.

It's a bit clunky. Please give it a try and tell me what you think. We might want to revert this given how the key focus stays, so there can be two seemingly selected elements at the same time (one of the buttons via keys, one via the mouse).

Reading that, and without testing yet, it indeed feels it's not a clear cut improvement, especially considering it's not clear to me that this is going to be useful in practice (see above). So I'm in favour of a revert right now.

but OTOH keyboard navigation seems to be good enough. I suggest we try to patch our extension so that the "push button" suffix is not added -- don't spend more than 20 minutes on that. And then, regardless of the outcome, we can call the current state good enough and close this ticket.

Fixed in

> eab3a6e Simplify accessibility notification for Restart/Power Off.
> 

I find eab3a6e a bit scary, but that's because I lack expertise in this area so I am not able to evaluate, with enough self-confidence, the side-effects of set_accessible_role(Atk.Role.UNKNOWN): we're basically removing information here, and I've no idea what else could be using that information; e.g. there must be a11y tools to get some kind of map/overview of a GUI, and knowing what widget is of what kind, and how it can be interacted with, seems to be potentially a pretty important part of this, no?

#30 Updated by anonym almost 4 years ago

  • Target version changed from Tails_1.6 to Tails_1.7

#31 Updated by anonym over 3 years ago

  • Assignee changed from anonym to intrigeri

intrigeri wrote:

So we have a real regression for mouse navigation,

I sort of fixed it in:

Yes, "sort of": sending accessibility events may be useful, but it doesn't make the GUI discoverable with the mouse only given the complex layout.

It's a bit clunky. Please give it a try and tell me what you think. We might want to revert this given how the key focus stays, so there can be two seemingly selected elements at the same time (one of the buttons via keys, one via the mouse).

Reading that, and without testing yet, it indeed feels it's not a clear cut improvement, especially considering it's not clear to me that this is going to be useful in practice (see above). So I'm in favour of a revert right now.

As you might guess, I'm rather happy to revert this. Done!

but OTOH keyboard navigation seems to be good enough. I suggest we try to patch our extension so that the "push button" suffix is not added -- don't spend more than 20 minutes on that. And then, regardless of the outcome, we can call the current state good enough and close this ticket.

Fixed in
[...]

I find eab3a6e a bit scary, but that's because I lack expertise in this area so I am not able to evaluate, with enough self-confidence, the side-effects of set_accessible_role(Atk.Role.UNKNOWN): we're basically removing information here, and I've no idea what else could be using that information; e.g. there must be a11y tools to get some kind of map/overview of a GUI, and knowing what widget is of what kind, and how it can be interacted with, seems to be potentially a pretty important part of this, no?

Probably, yes. I do not know how to otherwise make orca not say "push button", as you requested. Reverted!

So, we're back at what you described in #8302#note-27. My feeling is that I'll waste a lot of time trying to improve the situation, and IMHO the situation is quite good as it is (per your comment), so I think we can accept the situation as it is and close this ticket. Thoughts?

#32 Updated by intrigeri over 3 years ago

  • Status changed from In Progress to Resolved
  • Assignee deleted (intrigeri)
  • QA Check changed from Info Needed to Pass

Yes, the current situation is good enough => closing.

Also available in: Atom PDF