From 074c3dcbd6dd432be3bc8585b39c51d169dc51ad Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 9 Feb 2012 08:58:05 +1100 Subject: [PATCH] Bug 626813 - Hide plugins in background tabs to avoid trackpad drivers wanting to scroll them. r=jmathies --- widget/windows/nsWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index e8f4cf769522..9c677d7dbd16 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -7291,15 +7291,17 @@ nsWindow::SetWindowClipRegion(const nsTArray& 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)) {