GNOME Bugzilla – Bug 693149
idle-delay value ignored when locked
Last modified: 2014-01-08 21:45:38 UTC
In attempting to set the screensaver to lock after 'x' number of seconds, setting idle-delay and locking the value, that value is ignored. Unlocking the value enables the screensaver after the duration of idle-delay. Under certain situations this can also cause the screen to blank out and appear locked, but mouse/keyboard activity results in returning straight to the desktop and not to the unlock dialog (even with /org/gnome/desktop/screesaver/lock-delay set to 0) Environment: - Ubuntu 12.04.2 LTS (precise) - gnome-screensaver v3.4.1 Steps to reproduce: 1. Lock the value of /org/gnome/desktop/session/idle-delay by setuping up dconf as outlined at https://live.gnome.org/dconf/SystemAdministrators, specifically $ mkdir -p /etc/dconf/profile $ mkdir -p /etc/dconf/db/local.d $ mkdir -p /etc/dconf/db/site.d/locks $ cat /etc/dconf/profiles/user user-db:user system-db:local system-db:site $ cat /etc/dconf/db/site.d/screensaver [org/gnome/desktop/session] idle-delay=10 $ cat /etc/dconf/db/site.d/locks/screensaver /org/gnome/desktop/session/idle-delay 2. Run `dconf update` to updates these changes. 3. Verify that /org/gnome/desktop/session/idle-delay is locked (`dconf watch /` and then attempt to modify the value.) 4. Notice that after 10 seconds the screensaver does not activate nor does the screen begin to fade (indicating that it will soon lock). 5. Remove both `screensaver` files created above and update dconf again. 6. Manually set /org/gnome/desktop/session/idle-delay to 10 seconds. 7. Observe that after 10 seconds the screensaver appears.
Looking closer this may be a gsettings issue. https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1122028
GSettings schemas are very strict. The type of the value in the database must match directly, or it is ignored (and the default value as per the schema is taken). In this case, the expected type is a uint32, but you have a (signed) int32 in the database. Try like this: idle-delay=uint32 10 and it should work. Please reopen this bug if that doesn't fix it.
(In reply to comment #2) > Try like this: > > idle-delay=uint32 10 > > and it should work. > > Please reopen this bug if that doesn't fix it. Got bit by this today. This is a conf file, not a programming language. Shouldn't the "principle of least surprise" rule here?
I can only tell you the technical reason that it is as it is: dconf doesn't have schemas, so it has no way to know what the correct type of this key is at the time that it compiles the database. If it gets into the database with the wrong type, it will be ignored. Could be an argument toward changing the type of this key in gnome-screensaver... or we could maybe reconsider attempting to fallback for mismatched types in dconf databases when we hit them with GSettings....