Bug 626813 - Hide plugins in background tabs to avoid trackpad drivers wanting to scroll them. r=jmathies

This commit is contained in:
Cameron McCormack 2012-02-09 08:58:05 +11:00
parent 74e7a459bf
commit 074c3dcbd6

View File

@ -7291,15 +7291,17 @@ nsWindow::SetWindowClipRegion(const nsTArray<nsIntRect>& aRects,
}
}
// If a plugin is not visibile, especially if it is in a background tab,
// If a plugin is not visible, especially if it is in a background tab,
// it should not be able to steal keyboard focus. This code checks whether
// the region that the plugin is being clipped to is NULLREGION. If it is,
// the plugin window gets disabled.
if(mWindowType == eWindowType_plugin) {
if(NULLREGION == ::CombineRgn(dest, dest, dest, RGN_OR)) {
::ShowWindow(mWnd, SW_HIDE);
::EnableWindow(mWnd, FALSE);
} else {
::EnableWindow(mWnd, TRUE);
::ShowWindow(mWnd, SW_SHOW);
}
}
if (!::SetWindowRgn(mWnd, dest, TRUE)) {