Implement display.onidle event.
authorGuo Rui <firemeteor@Adam.(none)>
Sun, 12 Jul 2009 15:51:32 +0000 (12 23:51 +0800)
committerGuo Rui <firemeteor@Adam.(none)>
Sun, 12 Jul 2009 15:51:32 +0000 (12 23:51 +0800)
src/display.c
src/display.h
src/script.c

index 74ce3e6..4ac4300 100644 (file)
@@ -4198,6 +4198,9 @@ char *data;
   olddisplay = display;
   flayer = D_forecv->c_layer;
   fore = D_fore;
+#ifdef SCRIPT
+  trigger_sevent(display->d_sev.onidle, display);
+#endif
   DoAction(&idleaction, -1);
   if (idleaction.nr == RC_BLANKER)
     return;
index ee5a03b..cd38cda 100644 (file)
@@ -225,6 +225,9 @@ struct display
   int   d_blankerpid;
   struct event d_blankerev;
 #endif
+  struct {
+      struct script_event onidle;
+  } d_sev;
 };
 
 #ifdef MULTI
index b16c6a7..3f5acb8 100644 (file)
@@ -190,6 +190,8 @@ struct sev_description {
 } event_table[] = {
       /* NOTE: Manually sorted in Alphabet order! */
 
+      /* Display events*/
+      {"display_idle", "d", offsetof(struct display, d_sev.onidle)},
       /* Global events */
       {"global_cmdexecuted", "sS", offsetof(struct gevents, cmdexecuted)},
       {"global_detached", "di", offsetof(struct gevents, detached)},