Trigger onfocus onleave event when switch between regions.
authorRui Guo <firemeteor.guo@gmail.com>
Mon, 22 Jun 2009 08:09:15 +0000 (22 16:09 +0800)
committerRui Guo <firemeteor.guo@gmail.com>
Mon, 22 Jun 2009 08:09:15 +0000 (22 16:09 +0800)
src/process.c

index 8903314..8d50b27 100644 (file)
@@ -4025,7 +4025,20 @@ int key;
          RethinkDisplayViewports();
          ResizeLayersToCanvases();     /* redisplays */
        }
+#ifdef SCRIPT
+      {
+        struct win *oldfore = D_fore;
+        fore = D_fore = Layer2Window(D_forecv->c_layer);
+        if (oldfore && oldfore != fore)
+          {
+            trigger_sevent(&oldfore->w_sev.onleave, display, oldfore);
+            if (fore)
+              trigger_sevent(&fore->w_sev.onfocus, display, oldfore);
+          }
+      }
+#else
       fore = D_fore = Layer2Window(D_forecv->c_layer);
+#endif
       if (D_other == fore)
        D_other = 0;
       flayer = D_forecv->c_layer;