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
Родитель 38179b9678
Коммит 2b35da65e2
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -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 |

Просмотреть файл

@ -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);