diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-05-14 21:49:07 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-05-14 21:49:07 +0000 |
commit | 2ce4523624b67b48da037beceffe5710144850ec (patch) | |
tree | d9b89144c590890b60ca2892244560305cd82775 /input/manager.c | |
parent | 021c7fa891b23d8623beebf3f9ee79a36a1ff174 (diff) |
Add support for IdleTimeout config option
Diffstat (limited to 'input/manager.c')
-rw-r--r-- | input/manager.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/input/manager.c b/input/manager.c index 618641f1..13ca178d 100644 --- a/input/manager.c +++ b/input/manager.c @@ -63,6 +63,8 @@ struct pending_req { GIOChannel *ctrl_channel; }; +static int idle_timeout = 0; + static GSList *device_paths = NULL; /* Input registered paths */ static DBusConnection *connection = NULL; @@ -227,6 +229,8 @@ static void interrupt_connect_cb(GIOChannel *chan, int err, gpointer user_data) g_io_channel_close(chan); g_io_channel_unref(chan); + hidp.idle_to = idle_timeout * 60; + extract_hid_record(pr->hid_recs->data, &hidp); if (pr->pnp_recs) extract_pnp_record(pr->pnp_recs->data, &hidp); @@ -753,9 +757,18 @@ static DBusSignalVTable manager_signals[] = { { NULL, NULL } }; -int input_manager_init(DBusConnection *conn) +int input_manager_init(DBusConnection *conn, GKeyFile *config) { - dbus_connection_set_exit_on_disconnect(conn, TRUE); + GError *err = NULL; + + if (config) { + idle_timeout = g_key_file_get_integer(config, "General", + "IdleTimeout", &err); + if (err) { + debug("input.conf: %s", err->message); + g_error_free(err); + } + } if (!dbus_connection_create_object_path(conn, INPUT_PATH, NULL, manager_unregister)) { |