This commit is contained in:
Jim Mathies 2011-02-05 17:13:30 -06:00
Родитель 5068dbf54a 37000e63ae
Коммит c0f1b5b1af
4 изменённых файлов: 16 добавлений и 54 удалений

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

@ -124,7 +124,6 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
, mWinlessPopupSurrogateHWND(0)
, mWinlessThrottleOldWndProc(0)
, mWinlessHiddenMsgHWND(0)
, mMouseHook(NULL)
#endif // OS_WIN
, mAsyncCallMutex("PluginInstanceChild::mAsyncCallMutex")
#if defined(OS_MACOSX)
@ -1043,42 +1042,6 @@ PluginInstanceChild::RegisterWindowClass()
return RegisterClassEx(&wcex) ? true : false;
}
static inline void
HandleMouseCapture(HWND aWnd, UINT aMessage)
{
// Make sure capture is released by the child on mouse events. Fixes a
// problem with flash full screen mode mouse input. Appears to be
// caused by a bug in flash, since we are not setting the capture
// on the window. (In non-oopp land, we would set and release via
// widget for other reasons.)
switch (aMessage) {
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
SetCapture(aWnd);
break;
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP:
ReleaseCapture();
break;
}
}
LRESULT CALLBACK MouseHookProc(int code,
WPARAM wParam,
LPARAM lParam)
{
if (code == HC_ACTION) {
MOUSEHOOKSTRUCT* hookStruct =
reinterpret_cast<MOUSEHOOKSTRUCT*>(lParam);
if (hookStruct)
HandleMouseCapture(hookStruct->hwnd, wParam);
}
return CallNextHookEx(NULL, code, wParam, lParam);
}
bool
PluginInstanceChild::CreatePluginWindow()
{
@ -1105,11 +1068,6 @@ PluginInstanceChild::CreatePluginWindow()
SetWindowLongPtrA(mPluginWindowHWND, GWLP_WNDPROC,
reinterpret_cast<LONG_PTR>(DefWindowProcA));
// Mouse capture hook for flash full screen capture bug
if (GetQuirks() & PluginModuleChild::QUIRK_FLASH_HOOK_MOUSE_CAPTURE) {
mMouseHook = SetWindowsHookEx(WH_MOUSE, MouseHookProc, NULL,
GetCurrentThreadId());
}
return true;
}
@ -1131,11 +1089,6 @@ PluginInstanceChild::DestroyPluginWindow()
DestroyWindow(mPluginWindowHWND);
mPluginWindowHWND = 0;
}
if (mMouseHook) {
UnhookWindowsHookEx(mMouseHook);
mMouseHook = NULL;
}
}
void
@ -1247,11 +1200,25 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
return 0;
}
HandleMouseCapture(hWnd, message);
LRESULT res = CallWindowProc(self->mPluginWndProc, hWnd, message, wParam,
lParam);
// Make sure capture is released by the child on mouse events. Fixes a
// problem with flash full screen mode mouse input. Appears to be
// caused by a bug in flash, since we are not setting the capture
// on the window. (In non-oopp land, we would set and release via
// widget for other reasons.)
switch (message) {
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP:
ReleaseCapture();
break;
}
if (message == WM_CLOSE)
self->DestroyPluginWindow();

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

@ -346,7 +346,6 @@ private:
nsIntPoint mPluginSize;
WNDPROC mWinlessThrottleOldWndProc;
HWND mWinlessHiddenMsgHWND;
HHOOK mMouseHook;
#endif
friend class ChildAsyncCall;

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

@ -1829,7 +1829,6 @@ PluginModuleChild::InitQuirksModes(const nsCString& aMimeType)
mQuirks |= QUIRK_FLASH_HOOK_SETLONGPTR;
mQuirks |= QUIRK_FLASH_HOOK_GETWINDOWINFO;
mQuirks |= QUIRK_FLASH_MASK_CLEARTYPE_SETTINGS;
mQuirks |= QUIRK_FLASH_HOOK_MOUSE_CAPTURE;
}
#endif
}

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

@ -238,9 +238,6 @@ public:
// Win: Flash trashes the alpha channel in our buffers when cleartype
// is enabled. Mask this setting so they don't know it's enabled.
QUIRK_FLASH_MASK_CLEARTYPE_SETTINGS = 1 << 6,
// Win: Addresses a flash bug with mouse capture and full screen
// windows.
QUIRK_FLASH_HOOK_MOUSE_CAPTURE = 1 << 7,
};
int GetQuirks() { return mQuirks; }