--- kdefx/kstyle.cpp
+++ kdefx/kstyle.cpp
@@ -31,6 +31,7 @@
 
 #include <qapplication.h>
 #include <qbitmap.h>
+#include <qmetaobject.h>
 #include <qcleanuphandler.h>
 #include <qmap.h>
 #include <qimage.h>
@@ -79,7 +80,7 @@
 		QWidget* w1;
 		QWidget* w2;
 	};
-	typedef QMap<const QPopupMenu*,ShadowElements> ShadowMap;
+	typedef QMap<const QWidget*,ShadowElements> ShadowMap;
         static ShadowMap *_shadowMap = 0;
         QSingleCleanupHandler<ShadowMap> cleanupShadowMap;
         ShadowMap &shadowMap() {
@@ -113,8 +114,13 @@
 
 	const double shadow_strip[4] =
 		{ 0.565, 0.675, 0.835, 0.945 };
-}
 
+	static bool useDropShadow(QWidget* w)
+	{
+		return w && w->metaObject() && 
+			w->metaObject()->findProperty("KStyleMenuDropShadow") != -1;
+	}
+}
 
 namespace
 {
@@ -128,12 +134,12 @@
 
 	protected:
 		void blendToColor(const QColor &col);
-		void blendToPixmap(const QColorGroup &cg, const QPopupMenu* p);
+		void blendToPixmap(const QColorGroup &cg, const QWidget* p);
 #ifdef HAVE_XRENDER
-		void XRenderBlendToPixmap(const QPopupMenu* p);
+		void XRenderBlendToPixmap(const QWidget* p);
 #endif
-		void createShadowWindows(const QPopupMenu* p);
-		void removeShadowWindows(const QPopupMenu* p);
+		void createShadowWindows(const QWidget* p);
+		void removeShadowWindows(const QWidget* p);
 		void rightShadow(QImage& dst);
 		void bottomShadow(QImage& dst);
 	private:
@@ -256,8 +262,16 @@
 				widget->installEventFilter(this);
 		} 
 	}
-}
+	if (widget->isTopLevel())
+	{
+		if (!d->menuHandler && useDropShadow(widget))
+			d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, false);
 
+		if (d->menuHandler && useDropShadow(widget))
+			widget->installEventFilter(d->menuHandler);
+	}
+}
+
 
 void KStyle::unPolish( QWidget* widget )
 {
@@ -267,8 +281,10 @@
 			QFrame::Shape shape = frame->frameShape();
 			if (shape == QFrame::ToolBarPanel || shape == QFrame::MenuBarPanel)
 				widget->removeEventFilter(this);
-		} 
+		}
 	}
+	if (widget->isTopLevel() && d->menuHandler && useDropShadow(widget))
+		widget->removeEventFilter(d->menuHandler);
 }
 
 
@@ -1985,7 +2001,7 @@
 }
 
 // Create a shadow of thickness 4.
-void TransparencyHandler::createShadowWindows(const QPopupMenu* p)
+void TransparencyHandler::createShadowWindows(const QWidget* p)
 {
 #ifdef Q_WS_X11
 	int x2 = p->x()+p->width();
@@ -2032,7 +2048,7 @@
 #endif
 }
 
-void TransparencyHandler::removeShadowWindows(const QPopupMenu* p)
+void TransparencyHandler::removeShadowWindows(const QWidget* p)
 {
 #ifdef Q_WS_X11
 	ShadowMap::iterator it = shadowMap().find(p);
@@ -2058,7 +2074,7 @@
 	// Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
 
 	// Added 'fake' menu shadows <04-Jul-2002> -- Karol
-	QPopupMenu* p = (QPopupMenu*)object;
+	QWidget* p = (QWidget*)object;
 	QEvent::Type et = event->type();
 
 	if (et == QEvent::Show)
@@ -2097,13 +2113,23 @@
 		// * shadows after duplicate show events.
 		// * TODO : determine real cause for duplicate events
 		// * till 20021005
-		if (dropShadow && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p ))
+		if ((dropShadow  || useDropShadow(p))
+		    && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p ))
 			createShadowWindows(p);
 	}
+        else if (et == QEvent::Resize && p->isShown() && p->isTopLevel())
+        {
+		// Handle drop shadow
+		if (dropShadow || useDropShadow(p))
+		{
+			removeShadowWindows(p);
+			createShadowWindows(p);
+		}
+        }
 	else if (et == QEvent::Hide)
 	{
 		// Handle drop shadow
-		if (dropShadow)
+		if (dropShadow || useDropShadow(p))
 			removeShadowWindows(p);
 
 		// Handle translucency
@@ -2128,7 +2154,7 @@
 }
 
 
-void TransparencyHandler::blendToPixmap(const QColorGroup &cg, const QPopupMenu* p)
+void TransparencyHandler::blendToPixmap(const QColorGroup &cg, const QWidget* p)
 {
 	if (opacity < 0.0 || opacity > 1.0)
 		return;
@@ -2141,7 +2167,10 @@
 		return;
 
 	// Allow styles to define the blend pixmap - allows for some interesting effects.
-	kstyle->renderMenuBlendPixmap( blendPix, cg, p );
+	if (::qt_cast<QPopupMenu*>(p))
+		kstyle->renderMenuBlendPixmap( blendPix, cg, ::qt_cast<QPopupMenu*>(p) );
+	else
+		blendPix.fill(cg.button());	// Just tint as the default behavior
 
 	QImage blendImg = blendPix.convertToImage();
 	QImage backImg  = pix.convertToImage();
@@ -2154,13 +2183,17 @@
 // Here we go, use XRender in all its glory.
 // NOTE: This is actually a bit slower than the above routines
 // on non-accelerated displays. -- Karol.
-void TransparencyHandler::XRenderBlendToPixmap(const QPopupMenu* p)
+void TransparencyHandler::XRenderBlendToPixmap(const QWidget* p)
 {
 	KPixmap renderPix;
 	renderPix.resize( pix.width(), pix.height() );
 
 	// Allow styles to define the blend pixmap - allows for some interesting effects.
-	kstyle->renderMenuBlendPixmap( renderPix, p->colorGroup(), p );
+	if (::qt_cast<QPopupMenu*>(p))
+	   kstyle->renderMenuBlendPixmap( renderPix, p->colorGroup(),
+			   ::qt_cast<QPopupMenu*>(p) );
+	else
+		renderPix.fill(p->colorGroup().button());	// Just tint as the default behavior
 
 	Display* dpy = qt_xdisplay();
 	Pixmap   alphaPixmap;
