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
This commit is contained in:
Ray Kraesig 2024-11-14 18:01:43 +00:00
parent a72cb34ac5
commit e5accd9fe1
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -1821,6 +1821,8 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues(
nsCOMPtr<nsIWindowsUIUtils> 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 {