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 781760 - Don't disable extensions when screen is locked
Don't disable extensions when screen is locked
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: lock-screen
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-04-26 11:52 UTC by Jan Niklas Hasse (Account disabled)
Modified: 2021-07-05 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow extensions to be shown in the lock-screen (487 bytes, patch)
2017-09-04 09:58 UTC, Jan Niklas Hasse (Account disabled)
needs-work Details | Review

Description Jan Niklas Hasse (Account disabled) 2017-04-26 11:52:22 UTC
When logging back in after a screen lock GNOME Shell reloads all extensions. Depending on the computer speed and number of extensions, this can take several seconds. If someone really wants to save power, he should use suspend.

This also causes some bugs with several extensions:

 * Pixel Saver (https://extensions.gnome.org/extension/723/pixel-saver/) needs to unmaximize, maximize all maximized Windows so that the caption stays hidden. This looks rather ugly.
 * System Monitor (https://extensions.gnome.org/extension/120/system-monitor/) loses its history, because it isn't running while the screen is lock.
 * App Indicators (https://extensions.gnome.org/extension/615/appindicator-support/) sometimes disappear because the programs are still running, but the DBus interface disappears during the lock.

Extensions shouldn't appear on the lock screen though, see https://bugzilla.gnome.org/show_bug.cgi?id=686763
Comment 1 Florian Müllner 2017-04-26 12:12:37 UTC
(In reply to Jan Niklas Hasse from comment #0)

> Extensions shouldn't appear on the lock screen though, see
> https://bugzilla.gnome.org/show_bug.cgi?id=686763

So you are saying that we should leave extensions enabled on screen lock, but somehow remove them from the lock screen? How do you imagine that to work?

As far as I can see, we would need to rely on extensions themselves to handle screen lock correctly, which would likely result in a major break. So the most I see us doing would be to allow extensions to opt out of getting disabled automatically, not to stop doing it altogether.
Comment 2 WyRe 2017-04-26 12:18:32 UTC
Could not be locked the access to that extensions even they are loaded?
Comment 3 Florian Müllner 2017-04-26 12:21:37 UTC
Sorry, I don't understand that suggestion.
Comment 4 WyRe 2017-04-26 12:50:00 UTC
The extension keeps loaded but their access will be locked, and a third person only can get info (as much) from extensions like system monitor (for instance), maybe that should be a extension's dev task though.
Comment 5 Jan Niklas Hasse (Account disabled) 2017-04-26 12:55:54 UTC
> So you are saying that we should leave extensions enabled on screen lock, but somehow remove them from the lock screen? How do you imagine that to work?

The top panel on the screen lock could be a different panel. It already looks different and only includes the shutdown / volume indicator.
Comment 6 WyRe 2017-04-26 13:31:03 UTC
(In reply to Jan Niklas Hasse from comment #5)
> top panel on the screen lock could be a different panel. It already
> looks different and only includes the shutdown / volume indicator.

I support that :D
Comment 7 Florian Müllner 2017-04-27 12:24:07 UTC
(In reply to WyRe from comment #4)
> The extension keeps loaded but their access will be locked

Sorry, but that's hand-waving. What kind of "access" are you talking about? And what exactly do you mean by "locked"?

Not to mention that it's generally not possible to know whether some code has been called from an extension or some other part of gnome-shell.
Comment 8 Florian Müllner 2017-04-27 12:26:32 UTC
(In reply to Jan Niklas Hasse from comment #5)
> > So you are saying that we should leave extensions enabled on screen lock, but somehow remove them from the lock screen? How do you imagine that to work?
> 
> The top panel on the screen lock could be a different panel. It already
> looks different and only includes the shutdown / volume indicator.

OK, what about system modal dialogs or notifications then? Or any other change extensions may make that doesn't boil down to adding an icon to the top bar ...
Comment 9 Jan Niklas Hasse (Account disabled) 2017-04-27 13:43:18 UTC
> OK, what about system modal dialogs or notifications then? Or any other change > extensions may make that doesn't boil down to adding an icon to the top bar ...

Good point. But most extensions only show modal dialogs when I click somewhere in their interface, which wouldn't show in the "lock screen panel".
Comment 10 Florian Müllner 2017-04-27 15:26:23 UTC
(In reply to Jan Niklas Hasse from comment #9)
> But most extensions only show modal dialogs when I click
> somewhere in their interface, which wouldn't show in the "lock screen panel".

Sure, but you are not asking to change the behavior for *most* extensions, but for *all* of them. *Most* extensions handle disable/enable correctly ;-)
Comment 11 Jan Niklas Hasse (Account disabled) 2017-04-27 18:41:08 UTC
You're right.

Would you agree to enable a setting (in metadata.json?) for extensions to opt-out?

Is there already a way for an extension to figure out if it gets disabled because of screen-lock or normally?
Comment 12 Florian Müllner 2017-04-27 20:31:28 UTC
(In reply to Jan Niklas Hasse from comment #11)
> Would you agree to enable a setting (in metadata.json?) for extensions to
> opt-out?

Let's say I could be convinced, though I'm a bit worried that in many cases it'll be used to just paper over bugs (from the examples cited above, only the systemMonitor one sounds like a genuine use case).


> Is there already a way for an extension to figure out if it gets disabled
> because of screen-lock or normally?

Yes, but IMHO any extension that is caught gaming the system like that shouldn't pass review on extensions.gnome.org.
Comment 13 Florian Müllner 2017-04-27 21:06:44 UTC
(In reply to Jan Niklas Hasse from comment #0)
>  * Pixel Saver (https://extensions.gnome.org/extension/723/pixel-saver/)
> needs to unmaximize, maximize all maximized Windows so that the caption
> stays hidden. This looks rather ugly.

Filed as bug 781862 - we could have fixed that years ago if someone had bothered to file a bug instead of working around the issue :-(
Comment 14 Jan Niklas Hasse (Account disabled) 2017-04-28 17:55:09 UTC
One problem remains:

> Depending on the computer speed and number of extensions, this can take several > seconds.

@WyRe: You were the one on IRC asking about this, right? Could you post a list of the extensions you're using?
Comment 15 Florian Müllner 2017-04-28 20:33:44 UTC
(In reply to Jan Niklas Hasse from comment #14)
> One problem remains:
> 
> > Depending on the computer speed and number of extensions, this can take several > seconds.

That sounds like an extension doing sync IO or expensive computations when enabled. Saying we shouldn't disable extensions during screen lock so those extensions "only" block during startup isn't a very convincing argument ...
Comment 16 Jan Niklas Hasse (Account disabled) 2017-04-28 21:36:33 UTC
I agree, that's why I wanted to know what kind of extensions he's using.
Comment 17 Kamil Prusko 2017-05-01 09:17:07 UTC
It would be handy for some extensions like Hamster, Skype, Pomodoro, To Do Lists to have Lock Screen integration - not necessarily indicators, but to show notifications at least.

I agree that certain extensions like window-list, alt-tab better be disabled as they would be out of context. Extensions that wish Lock Screen integration should restrict themselves.
Comment 18 Jan Niklas Hasse (Account disabled) 2017-05-23 10:31:05 UTC
> it'll be used to just paper over bugs (from the examples cited above, only the systemMonitor one sounds like a genuine use case).

What would be the bug in the App Indicators case?
Comment 19 Florian Müllner 2017-05-23 13:31:02 UTC
(In reply to Jan Niklas Hasse from comment #18)
> > it'll be used to just paper over bugs (from the examples cited above, only the systemMonitor one sounds like a genuine use case).
> 
> What would be the bug in the App Indicators case?

If I recall correctly, the NotifierHost (or what it was called) coming and going is something items have to deal with.
Comment 20 zagortenay333 2017-06-23 16:38:49 UTC
An opt-in would be really nice.
Comment 21 Jan Niklas Hasse (Account disabled) 2017-07-13 19:23:04 UTC
Wouldn't it be better for extensions, which only have indicators, to talk to GNOME Shell via DBus? This could be used to fix this issue and it would make them run in a separate process and might result in performance and stability improvements.
Comment 22 zagortenay333 2017-09-04 08:07:03 UTC
Just as an example, my time++ extension would benefit tremendously from being able to work in the lock screen in some way:
https://github.com/zagortenay333/timepp__gnome/issues/5

It's a timer, stopwatch, alarm, pomodoro, and time-tracker, all of which become useless when the user locks the screen. :/
Comment 23 Jan Niklas Hasse (Account disabled) 2017-09-04 09:58:52 UTC
Created attachment 359063 [details] [review]
Allow extensions to be shown in the lock-screen

If an extension sets 'show-in-lock-screen': true in its metadata.json, it won't get disabled when locking the screen.
Comment 24 Jan Niklas Hasse (Account disabled) 2017-09-04 10:19:45 UTC
With my patch you can add 'show-in-lock-screen': true to your metadata.json which will allow time++ to run even when the screen is locked (opt-out as Florian suggested in #1). Of course the problem is now, that anyone can completely use the extension from the lock-screen and therefore see sensible information (todo tasks).

This could be solved by calling Main.panel.statusArea.timepp.actor.hide(). Is there a way to do this automatically?
Comment 25 zagortenay333 2017-09-04 11:17:57 UTC
Well, the extension could decide whether or not to expose sensitive info. I would hide the todo manager, but maybe add an option to expose the timer/stopwatch/pomodoro, for example.

By making it possible for the extension to know when it enters the lock-screen, the concerns raised by Florian go away too. If you know you're in the lock screen, don't create modal dialogs.
Comment 26 Jan Niklas Hasse (Account disabled) 2017-09-04 12:43:33 UTC
Can you try if you can do that in your extension? Maybe

Main.sessionMode.connect('updated', …)

or something like that.
Comment 27 zagortenay333 2017-09-04 14:23:30 UTC
Yeah, you can listen on that signal, but I'm no sure what to do to prevent the extension from being disabled.
Either way, it's 'gaming the system' as Florian put it. It has to be explicitly supported by gnome-shell.
Comment 28 Jan Niklas Hasse (Account disabled) 2017-09-04 16:44:24 UTC
I mean listening on that signal in combination with my patch ;)
Comment 29 Florian Müllner 2017-09-21 18:43:08 UTC
Review of attachment 359063 [details] [review]:

This doesn't work as advertised - the name suggests that the extension is shown on the lock screen, but it's actually shown in *any* mode.

Also see https://bugzilla.gnome.org/show_bug.cgi?id=787454#c3 for a more general proposal.
Comment 30 Jan Niklas Hasse (Account disabled) 2017-09-21 19:48:47 UTC
Thanks for the review, it was my first dive into the GNOME Shell code.

I thought about that. What other modes are there though? If I understand it correctly extensions aren't loaded in GDM anyway.
Comment 31 Florian Müllner 2017-09-21 22:12:29 UTC
(In reply to Jan Niklas Hasse from comment #30)
> What other modes are there though?

There's no definite answer to that - upstream we have:
 - user
 - gdm
 - lock-screen
 - unlock-dialog
 - classic
 - initial-setup

But modes can be defined externally by distros (ubuntu) or system administrators (for example for kiosk systems).


> If I understand it correctly extensions aren't loaded in GDM anyway.

Yes, but they aren't loaded because GDM's session mode doesn't have the allowExtensions flag set. (Your patch doesn't change that, but see the aforementioned bug for a use case of extensions on the login screen ...)
Comment 32 Jan Niklas Hasse (Account disabled) 2017-10-03 20:58:57 UTC
What do you think about keep-enabled-on-mode-changes for the name of the metadata flag?
Comment 33 GNOME Infrastructure Team 2021-07-05 14:35:06 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.