Merge lp:~vikoadi/pantheon-greeter/manage-screensaver into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Merged at revision: 346
Proposed branch: lp:~vikoadi/pantheon-greeter/manage-screensaver
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 77 lines (+36/-2) (has conflicts)
3 files modified
data/pantheon-greeter.conf.OTHER (+6/-0)
src/PantheonGreeter.vala (+19/-0)
src/Wallpaper.vala (+11/-2)
Contents conflict in data/pantheon-greeter.conf
Text conflict in src/PantheonGreeter.vala
To merge this branch: bzr merge lp:~vikoadi/pantheon-greeter/manage-screensaver
Reviewer Review Type Date Requested Status
Cody Garver (community) Needs Fixing
Viko Adi Rahmawan (community) Needs Resubmitting
Review via email: mp+244680@code.launchpad.net

Commit message

manage screensaver so that display will turned off after delay
* set delay to 60 on startup
* add org.pantheon.desktop.greeter screensaver-timeout to set delay when greeter used as lockscreen
* restore user screensaver delay on login
* use /etc/lightdm/pantheon-greeter.conf instead of GLib.Gsettings

Description of the change

manage screensaver so that display will turned off after delay
* set delay to 60 on startup
* add org.pantheon.desktop.greeter screensaver-timeout to set delay when greeter used as lockscreen
* restore user screensaver delay on login
* use /etc/lightdm/pantheon-greeter.conf instead of GLib.Gsettings

To post a comment you must log in.
Revision history for this message
Cameron Norman (cameronnemo) wrote :

Soooooooo when does this take effect? At the lock screen or in the normal pantheon session? Like if I just leave my computer without locking it the screen turns off after 60 seconds? Or if the computer is locked then after 60 seconds the screen turns off? Or both?

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

> Soooooooo when does this take effect? At the lock screen or in the normal
> pantheon session?
This only handle timeout in Pantheon greeter. it will have no effect in normal mode.

the "startup " i meant at description of change is pantheon-greeter's startup

> Like if I just leave my computer without locking it the
> screen turns off after 60 seconds?

No

> Or if the computer is locked then after 60
> seconds the screen turns off? Or both?

only turn off the screen on locker

after testing i still found something which doesnt work like i supposed it to:
* it can't get user gsetting's timeout, only the system default. so i can't change from 60 seconds timeout.
* saving and restoring normal timeout is still hit and miss

Revision history for this message
Raphael Isemann (teemperor) wrote :

Yeah accessing gsettings from other users is the big problem with the
greeter. Only clean way is to extend accountsservices (which is a PITA).
Am 15.12.2014 03:43 schrieb "Viko Adi Rahmawan" <email address hidden>:

> > Soooooooo when does this take effect? At the lock screen or in the normal
> > pantheon session?
> This only handle timeout in Pantheon greeter. it will have no effect in
> normal mode.
>
> the "startup " i meant at description of change is pantheon-greeter's
> startup
>
> > Like if I just leave my computer without locking it the
> > screen turns off after 60 seconds?
>
> No
>
> > Or if the computer is locked then after 60
> > seconds the screen turns off? Or both?
>
> only turn off the screen on locker
>
> after testing i still found something which doesnt work like i supposed it
> to:
> * it can't get user gsetting's timeout, only the system default. so i
> can't change from 60 seconds timeout.
> * saving and restoring normal timeout is still hit and miss
> --
>
> https://code.launchpad.net/~vikoadi/pantheon-greeter/manage-screensaver/+merge/244680
> Your team elementary Pantheon team is requested to review the proposed
> merge of lp:~vikoadi/pantheon-greeter/manage-screensaver into
> lp:pantheon-greeter.
>

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

Thanks,
So let just leave it to distro packaging to set their timeout, it's not supposed to be per-user setting anyway.

* and for saving and restoring timeout, I found out that lightdm-gtk-greeter behave the same, so this is the farthest i can get.

review: Needs Resubmitting
Revision history for this message
PerfectCarl (name-is-carl) wrote :

should this mp be tested ?

Revision history for this message
Cody Garver (codygarver) wrote :

I've tested it and it seems to work fine.

The only thing I don't like is that, in my opinion, this is a misuse to gsettings because only root's entry setting is respected. Like, maybe this timeout should be set somewhere like /etc/pantheon-greeter.conf

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Wouldn't it be possible to make light-locker do the x screen saver calls? Or maybe cerbere? This would allow us to read local settings. No idea about other implications though.

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

sorry for the late answer

@Cody: yeah, I'll try to use keyfile instead of gsettings for all pantheon-greeter settings

@Tom: Honestly i don't really know how light-locker works, i just recreate how lightdm-gtk-greeter works, and as teemperor said using AccountService is PITA

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

use /etc/lightdm/pantheon-greeter.conf instead of GLib.Settings

review: Needs Resubmitting
Revision history for this message
Cody Garver (codygarver) wrote :

All the options are commented out, but I uncommented to test them.

high-contrast=true - can't tell if this works or not
onscreen-keyboard=true - did not work
screensaver-timeout=5 - did not work

Revision history for this message
Cody Garver (codygarver) wrote :

Fails to start on an .iso I have already linked viko and teemperor privately. Here's the log:

** Message: PantheonGreeter.vala:329: Starting pantheon-greeter...
** Message: PantheonGreeter.vala:338: Applying settings...
** Message: Authenticator.vala:166: Connecting to LightDM...
** Message: Authenticator.vala:175: Successfully connected to LightDM.
** Message: PantheonGreeter.vala:95: Loading default-avatar...
** Message: PantheonGreeter.vala:98: Building UI...

(pantheon-greeter:1225): libindicator-WARNING **: File '/usr/lib/indicators3/7/libpower.so' does not exist.

(pantheon-greeter:1225): libindicator-WARNING **: File '/usr/lib/indicators3/7/libsoundmenu.so' does not exist.

(pantheon-greeter:1225): Gtk-WARNING **: Attempting to add a widget with type GtkBox to a KeyboardLayoutMenu, but as a GtkBin subclass a KeyboardLayoutMenu can only contain one widget at a time; it already contains a widget of type GtkImage

** (pantheon-greeter:1225): WARNING **: AccessibilityMenu.vala:26: Key file does not have key 'onscreen-keyboard'

** (pantheon-greeter:1225): WARNING **: AccessibilityMenu.vala:43: Key file does not have key 'high-contrast'

** (pantheon-greeter:1225): WARNING **: AccessibilityMenu.vala:53: Key file does not have key 'onscreen-keyboard'
** Message: PantheonGreeter.vala:111: Connecting signals...

(pantheon-greeter:1225): GLib-GIO-ERROR **: Settings schema 'org.pantheon.desktop.greeter' is not installed

However, org.pantheon.desktop.greeter does actually exist.

review: Needs Fixing
350. By Viko Adi Rahmawan

clean remaining gsetting dependency

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

@cody: can you please try latest revisions on top of the broken iso installation
thanks

Revision history for this message
Cody Garver (codygarver) wrote :

Seems to work now but needs conflicts resolved

Revision history for this message
Raphael Isemann (teemperor) wrote :

Just saying that the keyfile could break the testing mode as only root/lightdm can write to that keyfile (and the testing mode is done as a normal user).

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

@teemperor: pantheon-greeter doesn't crash, but ofcourse does'nt write to the keyfile, is that good enaough or should we write to a local .config keyfile?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/pantheon-greeter.conf.OTHER'
2--- data/pantheon-greeter.conf.OTHER 1970-01-01 00:00:00 +0000
3+++ data/pantheon-greeter.conf.OTHER 2015-02-06 16:12:08 +0000
4@@ -0,0 +1,6 @@
5+[greeter]
6+#activate-numlock=true
7+#default-wallpaper=/usr/share/backgrounds/elementaryos-default
8+#high-contrast=false
9+#onscreen-keyboard=false
10+#screensaver-timeout=60
11
12=== modified file 'src/PantheonGreeter.vala'
13--- src/PantheonGreeter.vala 2015-02-06 00:05:13 +0000
14+++ src/PantheonGreeter.vala 2015-02-06 16:12:08 +0000
15@@ -57,7 +57,17 @@
16 login_gateway = new LightDMGateway ();
17 }
18
19+<<<<<<< TREE
20 settings = new Settings ("org.pantheon.desktop.greeter");
21+=======
22+ settings = new KeyFile ();
23+ try {
24+ settings.load_from_file (Constants.CONF_DIR+"/pantheon-greeter.conf",
25+ KeyFileFlags.KEEP_COMMENTS);
26+ } catch (Error e) {
27+ warning (e.message);
28+ }
29+>>>>>>> MERGE-SOURCE
30
31 delete_event.connect (() => {
32 message ("Window got closed. Exiting...");
33@@ -86,6 +96,15 @@
34
35 login_gateway.login_successful.connect (() => {
36 fade_out_ui ();
37+<<<<<<< TREE
38+=======
39+
40+ /* restore screensaver setting, just like lightdm-gtk-greeter.c*/
41+ unowned X.Display display = (Gdk.Display.get_default () as Gdk.X11.Display).get_xdisplay ();
42+ message ("restore user timeout: %d", timeout);
43+ display.set_screensaver (timeout, interval, prefer_blanking,
44+ allow_exposures);
45+>>>>>>> MERGE-SOURCE
46 });
47
48 configure_event.connect (() => {
49
50=== modified file 'src/Wallpaper.vala'
51--- src/Wallpaper.vala 2014-11-08 07:40:43 +0000
52+++ src/Wallpaper.vala 2015-02-06 16:12:08 +0000
53@@ -54,7 +54,16 @@
54 }
55
56 string get_default () {
57- return new GLib.Settings ("org.pantheon.desktop.greeter").get_string ("default-wallpaper");
58+ var settings = new KeyFile();
59+ string default_wallpaper = "/usr/share/backgrounds/elementaryos-default";
60+ try{
61+ settings.load_from_file(Constants.CONF_DIR+"/pantheon-greeter.conf",
62+ KeyFileFlags.KEEP_COMMENTS);
63+ default_wallpaper = settings.get_string ("greeter", "default-wallpaper");
64+ } catch (Error e) {
65+ warning (e.message);
66+ }
67+ return default_wallpaper;
68 }
69
70 public void reposition () {
71@@ -210,4 +219,4 @@
72 tex.width = (int) (w * height / h);
73 }
74 }
75-}
76\ No newline at end of file
77+}

Subscribers

People subscribed via source and target branches