GNOME Bugzilla – Bug 759640
gnome-shell doesn't lock the screen when not using gdm
Last modified: 2021-07-05 14:32:44 UTC
Gnome-shell doesn't lock the screen, despite the preferences are correctly set in the GSettings keys. It might be related to the fact that Gdm is not being used (another display manager is being used).
Indeed. In order to lock the screen and log back in, we need to run a PAM reauth session, and that means we need the original session owner. Currently, we only support talking to gdm for that.
It is also possible to use XScreenSaver (or perhaps gnome-screensaver) and the following extension for Gnome-Shell: /* * Copyright © 2015 Guido Trentalancia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the licence, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * * Author: Guido Trentalancia <g.trentalancia@libero.it> */ /* * Extension to lock the screen from an icon on the panel using * XScreenSaver (http://www.jwz.org/xscreensaver). */ const Lang = imports.lang; const Shell = imports.gi.Shell; const St = imports.gi.St; const Util = imports.misc.util; const Main = imports.ui.main; let _lockScreenButton; function init() { _lockScreenButton = new St.Bin({ style_class: 'panel-button', reactive: true, can_focus: true, x_fill: true, y_fill: false, track_hover: true }); let icon = new St.Icon ({ icon_name: 'changes-prevent-symbolic', style_class: 'system-status-icon'}); _lockScreenButton.set_child(icon); _lockScreenButton.connect('button-press-event', _LockScreenActivate); } function _LockScreenActivate () { Main.overview.hide(); Util.spawnCommandLine('xscreensaver-command -lock'); } function enable () { Main.panel._rightBox.insert_child_at_index(_lockScreenButton, 0); } function disable () { Main.panel._rightBox.remove_child(_lockScreenButton); }
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.