Trigger window.onresize event.
authorGuo Rui <firemeteor@Adam.(none)>
Fri, 3 Jul 2009 14:18:33 +0000 (3 22:18 +0800)
committerGuo Rui <firemeteor@Adam.(none)>
Fri, 3 Jul 2009 14:18:33 +0000 (3 22:18 +0800)
src/resize.c
src/script.c

index 0bf5f3d..035b540 100644 (file)
@@ -977,6 +977,10 @@ int wi, he, hi;
   p->w_histheight = hi;
 #endif
 
+#ifdef SCRIPT
+  trigger_sevent(&p->w_sev.onresize, wi);
+#endif
+
 #ifdef BUILTIN_TELNET
   if (p->w_type == W_TYPE_TELNET)
     TelWindowSize(p);
index 42f5ff2..a0cd913 100644 (file)
@@ -205,7 +205,7 @@ struct sev_description {
       {"window_onhide", "dw", offsetof(struct win, w_sev.onhide)},
       /* window w lost its focus on display d. */
       {"window_onleave", "dw", offsetof(struct win, w_sev.onleave)},
-      {"window_onresize", "", offsetof(struct win, w_sev.onresize)},
+      {"window_onresize", "w", offsetof(struct win, w_sev.onresize)},
       /* window w first showed up on display d. When there are regions, it can
        * still be shown while losing focus. */
       {"window_onshow", "dw", offsetof(struct win, w_sev.onshow)},