summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-09-03 11:51:54 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-09-03 11:51:54 +0200
commit7148cf452c440d6f7ee753866275968188094fbc (patch)
tree6f0b19ccac857ab2bb3fb33d687abd71d066c724 /vdr.c
parent45a29e5b1614359d09aa3e69b8928fcfeebc84a2 (diff)
downloadvdr-7148cf452c440d6f7ee753866275968188094fbc.tar.gz
vdr-7148cf452c440d6f7ee753866275968188094fbc.tar.bz2
The menu timeout handling is now done centrally in the main program loop
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/vdr.c b/vdr.c
index 02347fd6..721ea11c 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.212 2005/09/03 11:26:27 kls Exp $
+ * $Id: vdr.c 1.213 2005/09/03 11:50:28 kls Exp $
*/
#include <getopt.h>
@@ -66,6 +66,7 @@
#define LASTCAMMENUTIMEOUT 3 // seconds to run the main loop 'fast' after a CAM menu has been closed
// in order to react on a possible new CAM menu as soon as possible
#define DEVICEREADYTIMEOUT 30 // seconds to wait until all devices are ready
+#define MENUTIMEOUT 120 // seconds of user inactivity after which an OSD display is closed
#define EXIT(v) { ExitCode = (v); goto Exit; }
@@ -806,8 +807,12 @@ int main(int argc, char *argv[])
Interact = Menu ? Menu : cControl::Control(); // might have been closed in the mean time
if (Interact) {
eOSState state = Interact->ProcessKey(key);
- if (state == osUnknown && ISMODELESSKEY(key) && cControl::Control() && Interact != cControl::Control())
- state = cControl::Control()->ProcessKey(key);
+ if (state == osUnknown) {
+ if (ISMODELESSKEY(key) && cControl::Control() && Interact != cControl::Control())
+ state = cControl::Control()->ProcessKey(key);
+ else if (time(NULL) - LastActivity > MENUTIMEOUT)
+ state = osEnd;
+ }
switch (state) {
case osPause: DELETENULL(Menu);
cControl::Shutdown(); // just in case