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>
This commit is contained in:
Frederic Plourde
2014-10-30 15:06:34 -04:00
committed by Pekka Paalanen
parent e9fe467453
commit 4a84c83ad7
2 changed files with 25 additions and 4 deletions
+5 -1
View File
@@ -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;