From e5accd9fe1c5ab17cb1d2eb60d6ab3df619d46e2 Mon Sep 17 00:00:00 2001 From: Ray Kraesig Date: Thu, 14 Nov 2024 18:01:43 +0000 Subject: [PATCH] Bug 1929474 - [2/2] Document (some) other uses of Win10 tablet mode r=win-reviewers,firefox-desktop-core-reviewers ,handyman,mossop Document remaining uses of Win10 tablet-mode detection which do not fall under other bugs. In particular, we leave alone: * `IsTabletDevice` in WinUtils.cpp. This falls under bug 1735765. * Uses in WinIMEHandler.{h,cpp}. These fall under bug 1929630. No functional changes. Differential Revision: https://phabricator.services.mozilla.com/D228206 --- browser/components/BrowserContentHandler.sys.mjs | 4 +++- xpfe/appshell/AppWindow.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/components/BrowserContentHandler.sys.mjs b/browser/components/BrowserContentHandler.sys.mjs index cb26e5de9d5d..0ae3f811b3e3 100644 --- a/browser/components/BrowserContentHandler.sys.mjs +++ b/browser/components/BrowserContentHandler.sys.mjs @@ -1585,7 +1585,9 @@ nsDefaultCommandLineHandler.prototype = { cmdLine.state != Ci.nsICommandLine.STATE_INITIAL_LAUNCH && lazy.WindowsUIUtils.inWin10TabletMode ) { - // In windows 10 tablet mode, do not create a new window, but reuse the existing one. + // In Win10's tablet mode, do not create a new window, but reuse the + // existing one. (Win11's tablet mode is still windowed and has no need + // for this workaround.) let win = lazy.BrowserWindowTracker.getTopWindow(); if (win) { win.focus(); diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 6119eddbd9e0..e47cff101ac8 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -1821,6 +1821,8 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( nsCOMPtr uiUtils( do_GetService("@mozilla.org/windows-ui-utils;1")); if (!NS_WARN_IF(!uiUtils)) { + // We switch to the touch-optimized layout in both Win10 and Win11 tablet- + // modes, since only the input mechanism is relevant. (See bug 1819421.) if (IsWin11OrLater()) { uiUtils->GetInWin11TabletMode(&isInTabletMode); } else {