Bug 1743057 - Notify windows visibility change to WindowOcclusionTracker when window is activated r=gfx-reviewers,jrmuizel

When Firefox was activated by Alt+Tabbing, there was a case that event hook of WindowOcclusionCalculator could not detect an event of window activated. Then it is necessary to trigger window occlusion calculation from nsWindows.

Differential Revision: https://phabricator.services.mozilla.com/D132206
This commit is contained in:
sotaro 2021-11-27 02:24:22 +00:00
Родитель 1eb9045821
Коммит 46903a643e
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -6716,6 +6716,12 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) {
if (mSizeMode == nsSizeMode_Minimized) return;
}
// Notify visibility change when window is activated.
if (!(wp->flags & SWP_NOACTIVATE) && NeedsToTrackWindowOcclusionState()) {
WinWindowOcclusionTracker::Get()->OnWindowVisibilityChanged(
this, mSizeMode != nsSizeMode_Minimized);
}
// Handle window position changes
if (!(wp->flags & SWP_NOMOVE)) {
mBounds.MoveTo(wp->x, wp->y);