From 93909df6d52da3ff0b235207a63f1f67f5e1104a Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 8 Mar 2012 17:21:09 +1100 Subject: [PATCH] Back out bug 725475 due to breaking scrolling on some machines --- ipc/glue/WindowsMessageLoop.cpp | 13 +++---------- widget/windows/nsWindow.cpp | 30 ++++++++---------------------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index e21827205b1..932db3c28f1 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -206,20 +206,17 @@ ProcessOrDeferMessage(HWND hwnd, case WM_CAPTURECHANGED: case WM_CHILDACTIVATE: case WM_DESTROY: - case WM_DISPLAYCHANGE: case WM_ENABLE: case WM_IME_NOTIFY: case WM_IME_SETCONTEXT: - case WM_KEYDOWN: - case WM_KEYUP: case WM_KILLFOCUS: case WM_MOUSEWHEEL: case WM_NCDESTROY: case WM_PARENTNOTIFY: case WM_SETFOCUS: case WM_SYSCOMMAND: - case WM_SHOWWINDOW: - case WM_VSCROLL: // Intentional fall-through. + case WM_DISPLAYCHANGE: + case WM_SHOWWINDOW: // Intentional fall-through. case WM_XP_THEMECHANGED: { deferred = new DeferredSendMessage(hwnd, uMsg, wParam, lParam); break; @@ -327,11 +324,7 @@ ProcessOrDeferMessage(HWND hwnd, log.AppendLiteral("\")"); } - log.AppendLiteral(", wParam = "); - log.AppendInt(wParam); - log.AppendLiteral(", lParam = "); - log.AppendInt(lParam); - log.AppendLiteral("; sending it to DefWindowProc instead of the normal " + log.AppendLiteral(", sending it to DefWindowProc instead of the normal " "window procedure."); NS_ERROR(log.get()); #endif diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 28cb01a142c..e499c5bcdbd 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -581,21 +581,19 @@ nsWindow::Create(nsIWidget *aParent, nsUXThemeData::dwmSetWindowAttributePtr(mWnd, DWMWA_NONCLIENT_RTL_LAYOUT, &dwAttribute, sizeof dwAttribute); } - if ((mWindowType == eWindowType_toplevel || - mWindowType == eWindowType_dialog || - mWindowType == eWindowType_popup) && + if (mWindowType != eWindowType_plugin && + mWindowType != eWindowType_invisible && MouseScrollHandler::Device::IsFakeScrollableWindowNeeded()) { - // Ugly Thinkpad Driver Hack (Bugs 507222, 594977 and 725475) + // Ugly Thinkpad Driver Hack (Bugs 507222 and 594977) // - // We create three zero-sized windows as descendants of the top-level - // window, like so: + // We create two zero-sized windows as descendants of the top-level window, + // like so: // // Top-level window (MozillaWindowClass) // FAKETRACKPOINTSCROLLCONTAINER (MozillaWindowClass) // FAKETRACKPOINTSCROLLABLE (MozillaWindowClass) - // FAKETRACKPOINTSCROLLBAR (ScrollBar) // - // We need to have the container window, otherwise the Trackpoint driver + // We need to have the middle window, otherwise the Trackpoint driver // will fail to deliver scroll messages. WM_MOUSEWHEEL messages are // sent to the FAKETRACKPOINTSCROLLABLE, which then propagate up the // window hierarchy until they are handled by nsWindow::WindowProc. @@ -606,11 +604,6 @@ nsWindow::Create(nsIWidget *aParent, // // The FAKETRACKPOINTSCROLLABLE needs to have the specific window styles it // is given below so that it catches the Trackpoint driver's heuristics. - // - // The FAKETRACKPOINTSCROLLBAR is needed for certain configurations of - // Synaptics drivers when a plugin window is visible and would otherwise - // attract all scrolling messages. A corresponding horizontal scrollbar - // does not seem to be needed to attract WM_HSCROLL messages. HWND scrollContainerWnd = ::CreateWindowW (className.get(), L"FAKETRACKPOINTSCROLLCONTAINER", WS_CHILD | WS_VISIBLE, @@ -619,15 +612,6 @@ nsWindow::Create(nsIWidget *aParent, (className.get(), L"FAKETRACKPOINTSCROLLABLE", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | 0x30, 0, 0, 0, 0, scrollContainerWnd, NULL, nsToolkit::mDllInstance, NULL); - HWND scrollBarWnd = ::CreateWindowW - (L"SCROLLBAR", L"FAKETRACKPOINTSCROLLBAR", - WS_CHILD | WS_VISIBLE | SBS_VERT, - 0, 0, 0, 0, mWnd, NULL, nsToolkit::mDllInstance, NULL); - - // We set the hidden scroll bar control to have a range of values and - // be positioned in the middle, so that scrolling up and down works. - SCROLLINFO scrollInfo = { sizeof SCROLLINFO, SIF_ALL, 0, 100, 1, 50, 50 }; - ::SetScrollInfo(scrollBarWnd, SB_CTL, &scrollInfo, FALSE); // Give the FAKETRACKPOINTSCROLLABLE window a specific ID so that // WindowProcInternal can distinguish it from the top-level window @@ -6869,9 +6853,11 @@ nsWindow::SetWindowClipRegion(const nsTArray& aRects, // 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)) {