Bug 940677 - Add pref to enable auto switching between Desktop/Metro for Laptop/Slates. r=bbondy

This commit is contained in:
Stephen Pohl 2013-12-10 12:53:59 -05:00
parent 94fd1ea978
commit 6d0cd970e0
2 changed files with 8 additions and 4 deletions

View File

@ -5495,8 +5495,10 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
if (IsWin8OrLater() && lParam &&
!wcsicmp(L"ConvertibleSlateMode", (wchar_t*)lParam)) {
// If we're switching into slate mode, switch to Metro for hardware
// that supports this feature.
if (GetSystemMetrics(SM_CONVERTIBLESLATEMODE) == 0) {
// that supports this feature if the pref is set.
if (GetSystemMetrics(SM_CONVERTIBLESLATEMODE) == 0 &&
Preferences::GetBool("browser.shell.desktop-auto-switch-enabled",
false)) {
nsCOMPtr<nsIAppStartup> appStartup(do_GetService(NS_APPSTARTUP_CONTRACTID));
if (appStartup) {
appStartup->Quit(nsIAppStartup::eForceQuit |

View File

@ -717,8 +717,10 @@ MetroWidget::WindowProcedure(HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLPara
} else if (WM_SETTINGCHANGE == aMsg) {
if (aLParam && !wcsicmp(L"ConvertibleSlateMode", (wchar_t*)aLParam)) {
// If we're switching away from slate mode, switch to Desktop for
// hardware that supports this feature.
if (GetSystemMetrics(SM_CONVERTIBLESLATEMODE) != 0) {
// hardware that supports this feature if the pref is set.
if (GetSystemMetrics(SM_CONVERTIBLESLATEMODE) != 0 &&
Preferences::GetBool("browser.shell.metro-auto-switch-enabled",
false)) {
nsCOMPtr<nsIAppStartup> appStartup(do_GetService(NS_APPSTARTUP_CONTRACTID));
if (appStartup) {
appStartup->Quit(nsIAppStartup::eForceQuit | nsIAppStartup::eRestart);