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>
dev
Frederic Plourde 10 years ago committed by Pekka Paalanen
parent e9fe467453
commit 4a84c83ad7
  1. 23
      man/weston.ini.man
  2. 6
      src/compositor.c

@ -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

@ -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;

Loading…
Cancel
Save