Bug 802316 - Remove WS_EX_COMPOSITED style from popups with WS_EX_LAYERED to prevent invisible context menus. r=roc
authorJames H <jh.dev0@gmail.com>
Wed, 17 Oct 2012 16:18:22 -0400
changeset 110873 4a4acb36e6701b595910f179d2930e5d006e17a5
parent 110872 fe90dfc8a30a1fce0cc2cf8078ac871a3f300399
child 110874 e0b2ebcbd56aebd151202e1a0d4f16c4462c172d
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersroc
bugs802316
milestone19.0a1
Bug 802316 - Remove WS_EX_COMPOSITED style from popups with WS_EX_LAYERED to prevent invisible context menus. r=roc
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1079,16 +1079,23 @@ NS_METHOD nsWindow::Show(bool bState)
         sDropShadowEnabled = false;
       }
     } else {
       if (!sDropShadowEnabled) {
         ::SetClassLongA(mWnd, GCL_STYLE, CS_DROPSHADOW);
         sDropShadowEnabled = true;
       }
     }
+
+    // WS_EX_COMPOSITED conflicts with the WS_EX_LAYERED style and causes
+    // some popup menus to become invisible.
+    LONG_PTR exStyle = ::GetWindowLongPtrW(mWnd, GWL_EXSTYLE);
+    if (exStyle & WS_EX_LAYERED) {
+      ::SetWindowLongPtrW(mWnd, GWL_EXSTYLE, exStyle & ~WS_EX_COMPOSITED);
+    }
   }
 
   bool syncInvalidate = false;
 
   bool wasVisible = mIsVisible;
   // Set the status now so that anyone asking during ShowWindow or
   // SetWindowPos would get the correct answer.
   mIsVisible = bState;