Skip to content

Commit

Permalink
Bug 1689884 - Inform PresShell when tablet-mode changes occur r=emilio
Browse files Browse the repository at this point in the history
Currently, PresShell is not informed when a system setting involving
Windows 10 Tablet Mode, System Dock Mode, or "Convertible Slate Mode" occur.

As this can change the result of @media (pointer) queries, layout should know
about this so it can react accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D107917
  • Loading branch information
Chris Martin committed Mar 11, 2021
1 parent 64c00be commit cfef04f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions widget/windows/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5313,6 +5313,21 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
}
}
}

// UserInteractionMode, ConvertibleSlateMode, SystemDockMode may cause
// @media(pointer) queries to change, which layout needs to know about
//
// (WM_SETTINGCHANGE will be sent to all top-level windows, so we
// only respond to the hidden top-level window to avoid hammering
// layout with a bunch of NotifyThemeChanged() calls)
//
if (mWindowType == eWindowType_invisible) {
if (!wcscmp(lParamString, L"UserInteractionMode") ||
!wcscmp(lParamString, L"ConvertibleSlateMode") ||
!wcscmp(lParamString, L"SystemDockMode")) {
NotifyThemeChanged(widget::ThemeChangeKind::MediaQueriesOnly);
}
}
}
} break;

Expand Down

0 comments on commit cfef04f

Please sign in to comment.