Firefox/Windows 8 Integration
< Firefox
Jump to navigation
Jump to search
Microsoft Windows 8 will be the next version of the Windows operating system which is aimed at desktops, laptops, netbooks, tablets, servers, and media center PCs. A major part of Windows 8 is the introduction of Metro-style applications which are based on the new WinRT APIs. This page will cover both Windows Metro integration and changes for existing Desktop integration.
Metro support in Windows 8
- Unlike Desktop, Metro apps will ONLY be available through the Windows store.
- There is no multi-tasking (Only one app will run unsuspended at a time).
- There are no overlapping windows, nor traditional popup windows, everything is chromeless, everything is designed to be consistent across applications.
- Interprocess communication is not possible. (no electrolysis?)
- Based on WinRT APIs, applications can be built in Javascript, C++, C#, or VB.NET. C++ compiles to native code but has some extra syntax flare.
- Not possible to simply and easily port Firefox as a Metro application. A significant amount of Win32 APIs will not be available in Metro.
- There is a new concept called contracts for interconnection/sharing with different metro apps.
- The 5 main contracts are: Search, Share, Start, Devices, and Settings.
- A second app can be shown in Metro app with the snap state. It is shown side by side and you can determine the width of each window via a separator.
- The top and bottom edges are for per app toolbars. The left and right edge are reserved for system toolbars (This my require Fennec redesign if we end up using it for Metro).
- You can schedule popup notifications when your Metro app is not running.
App Suspend/Resume
- Apps are suspended when not in foreground
- Desktop is treated as one app; all other Metro apps are suspended when desktop is active
- Upon suspension, app gets notification that it is being suspended
- At this point, app must save state because it could be terminated later without notice
- App gets 5s to handle suspend, otherwise crashes
- During suspension
- App is not scheduled by the NT kernel
- No CPU, Disk, Network consumption
- All threads suspended
- App remains in memory
- App is instantly resumed when brought to foreground
- Suspension best practices:
- Save state quickly (<5s)
- Assume you will be terminated: Save user session data
- Update app's tile
- Release exclusive access to shared resources (files, devices, network, etc)
- Save app data incrementally before suspend
Registering callbacks for suspend and resume (JS)
//Register for the Suspending event and call suspendingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingHandler); //Handle the suspending event and save the current user sesssion using WinJS sessionState function suspendingHandler(eventArgs) { //We are getting suspended } //Register for the Resuming event and call resumingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler); function resumingHandler() { //We are getting resumed, in general do nothing }
Desktop changes in Windows 8
- The start menu is removed. Clicking it now takes you to the Metro interface.
- It is unclear whether or not there will be Desktop support for ARM. If there is support, there will NOT be an emulation layer like WOW64 for x86 apps.
- Desktop apps do not get suspended when switching to Metro.
- There are taskbar imporvements for multi monitor (taskbar spanning)