summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Plourde <frederic.plourde@collabora.co.uk>2014-10-30 15:06:34 -0400
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-11-21 16:03:37 +0200
commit4a84c83ad79fed36f86058b003b7969f0ba664e9 (patch)
tree46e3ff8b3b65d3d6f4788ebd04a01ac7a31a69dd
parente9fe46745302e4add242078d00408ef6ecae3fb6 (diff)
downloadweston-4a84c83ad79fed36f86058b003b7969f0ba664e9.tar.gz
compositor: Add idle timeout option to weston.ini
Weston's idle timeout can already be set via the '-i' command-line option, but this patch lets users specify it also via weston.ini. Note that the command-line option takes precedence over the .ini, should the option be set by both. This patch also Updates weston.ini man page with idle-timeout bits https://bugs.freedesktop.org/show_bug.cgi?id=83921 Signed-off-by: Frederic Plourde <frederic.plourde@collabora.co.uk> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
-rw-r--r--man/weston.ini.man23
-rw-r--r--src/compositor.c6
2 files changed, 25 insertions, 4 deletions
diff --git a/man/weston.ini.man b/man/weston.ini.man
index 54a1925d..0f7d2da0 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -69,7 +69,7 @@ The section headers are:
.PP
.RS 4
.nf
-.BR "core " "The core modules"
+.BR "core " "The core modules and options"
.BR "libinput " "Input device configuration"
.BR "shell " "Desktop customization"
.BR "launcher " "Add launcher to the panel"
@@ -92,7 +92,7 @@ be given in decimal (e.g. 123), octal (e.g. 0173), and hexadecimal
.SH "CORE SECTION"
The
.B core
-section is used to select the startup compositor modules.
+section is used to select the startup compositor modules and general options.
.TP 7
.BI "shell=" desktop-shell.so
specifies a shell to load (string). This can be used to load your own
@@ -145,6 +145,23 @@ sets the GBM format used for the framebuffer for the GBM backend. Can be
By default, xrgb8888 is used.
.RS
.PP
+.RE
+.TP 7
+.BI "idle-time="seconds
+sets Weston's idle timeout in seconds. This idle timeout is the time
+after which Weston will enter an "inactive" mode and screen will fade to
+black. Note that a screensaver may also start at this moment after fade-out
+(if enabled in the SCREENSAVER section below), but the current idle-time
+option has nothing to do with screensavers.
+
+.IR Important
+: This option may also be set via Weston's '-i' command
+line option and will take precedence over the current .ini option. This
+means that if both weston.ini and command line define this idle-timeout
+time, the one specified in the command-line will be used. On the other
+hand, if none of these sets the value, default idle timeout will be
+set to 300 seconds.
+.RS
.SH "LIBINPUT SECTION"
The
@@ -295,7 +312,7 @@ is disabled.
.RE
.TP 7
.BI "duration=" 600
-The idle time in seconds until the screensaver disappears in order to save power
+The time in seconds until the screensaver disappears in order to save power
(unsigned integer).
.SH "OUTPUT SECTION"
There can be multiple output sections, each corresponding to one output. It is
diff --git a/src/compositor.c b/src/compositor.c
index 72fe3843..0db6d738 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -4713,7 +4713,7 @@ int main(int argc, char *argv[])
char *option_modules = NULL;
char *log = NULL;
char *server_socket = NULL, *end;
- int32_t idle_time = 300;
+ int32_t idle_time = -1;
int32_t help = 0;
char *socket_name = NULL;
int32_t version = 0;
@@ -4811,6 +4811,10 @@ int main(int argc, char *argv[])
catch_signals();
segv_compositor = ec;
+ if (idle_time < 0)
+ weston_config_section_get_int(section, "idle-time", &idle_time, -1);
+ if (idle_time < 0)
+ idle_time = 300; /* default idle timeout, in seconds */
ec->idle_time = idle_time;
ec->default_pointer_grab = NULL;
ec->exit_code = EXIT_SUCCESS;