diff --git a/clients/Makefile.am b/clients/Makefile.am index cfa984c09e..8906f81b1e 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = test keramik modernsystem default laptop redmond web quartz b2 +SUBDIRS = keramik modernsystem default laptop redmond web quartz b2 #SUBDIRS = default kde1 riscos redmond quartz icewm web b2 \ # modernsystem laptop system kwmtheme kstep keramik diff --git a/clients/test/test.cpp b/clients/test/test.cpp index f934a077f3..4d4de0a8bf 100644 --- a/clients/test/test.cpp +++ b/clients/test/test.cpp @@ -313,9 +313,12 @@ bool Decoration::animateMinimize(bool iconify) } return true; } - + KDecoration* Factory::createDecoration( KDecorationBridge* bridge ) { + NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK, bridge ); + if( type == NET::Dialog ) + ; return new Decoration( bridge, this ); } diff --git a/clients/test/test.h b/clients/test/test.h index c5acc82911..1cde924183 100644 --- a/clients/test/test.h +++ b/clients/test/test.h @@ -8,6 +8,10 @@ namespace KWinTest { +const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask + | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask + | NET::UtilityMask | NET::SplashMask; + class Decoration : public KDecoration { diff --git a/lib/kdecoration.cpp b/lib/kdecoration.cpp index e251908aff..fd5718b694 100644 --- a/lib/kdecoration.cpp +++ b/lib/kdecoration.cpp @@ -149,7 +149,7 @@ bool KDecoration::isResizable() const } NET::WindowType KDecoration::windowType( unsigned long supported_types ) const - { + { // this one is also duplicated in KDecorationFactory return bridge_->windowType( supported_types ); } diff --git a/lib/kdecorationfactory.cpp b/lib/kdecorationfactory.cpp index 0d85b3c9d0..555967443d 100644 --- a/lib/kdecorationfactory.cpp +++ b/lib/kdecorationfactory.cpp @@ -26,6 +26,8 @@ DEALINGS IN THE SOFTWARE. #include +#include "kdecoration_p.h" + KDecorationFactory::KDecorationFactory() { } @@ -67,3 +69,8 @@ void KDecorationFactory::resetDecorations( unsigned long changed ) ++it ) (*it)->reset( changed ); } + +NET::WindowType KDecorationFactory::windowType( unsigned long supported_types, KDecorationBridge* bridge ) const + { + return bridge->windowType( supported_types ); + } diff --git a/lib/kdecorationfactory.h b/lib/kdecorationfactory.h index 640f3c9b1d..da04c1b810 100644 --- a/lib/kdecorationfactory.h +++ b/lib/kdecorationfactory.h @@ -91,6 +91,14 @@ class KDecorationFactory * objects. */ void resetDecorations( unsigned long changed ); // convenience + /** + * This function has the same functionality like KDecoration::windowType(). + * It can be used in createDecoration() to return different KDecoration + * inherited classes depending on the window type, as at that time + * KDecoration::windowType() is not available yet. The additional argument + * is the one passed to createDecoration(). + */ + NET::WindowType windowType( unsigned long supported_types, KDecorationBridge* bridge ) const; private: QValueList< KDecoration* > _decorations; KDecorationFactoryPrivate* d;