diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp index f55b4b4a..1fd39a51 100644 --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -1431,6 +1431,7 @@ namespace Breeze } + //______________________________________________________________________________ bool Helper::isWayland( void ) { #if QT_VERSION >= 0x050000 diff --git a/kstyle/breezeshadowhelper.cpp b/kstyle/breezeshadowhelper.cpp index 32859f45..5226f1d4 100644 --- a/kstyle/breezeshadowhelper.cpp +++ b/kstyle/breezeshadowhelper.cpp @@ -173,28 +173,33 @@ namespace Breeze { if( Helper::isWayland() ) { + + #if BREEZE_HAVE_KWAYLAND QWidget* widget( static_cast( object ) ); if( event->type() == QEvent::Paint ) { + auto iter = _widgetSurfaces.constFind( widget ); if( iter == _widgetSurfaces.constEnd() ) { // install shadows and update winId installShadows( widget ); } - } - else if( event->type() == QEvent::Hide ) - { + + } else if( event->type() == QEvent::Hide ) { + auto iter = _widgetSurfaces.find( widget ); if( iter != _widgetSurfaces.end() ) { delete iter.value(); _widgetSurfaces.erase( iter ); } + } - } - else if( Helper::isX11() ) - { + #endif + + } else if( Helper::isX11() ) { + // check event type if( event->type() != QEvent::WinIdChange ) return false; @@ -437,7 +442,6 @@ namespace Breeze foreach( const quint32& value, pixmaps ) { data.append( value ); } - const QMargins margins = shadowMargins( widget ); const int topSize = margins.top(); const int bottomSize = margins.bottom(); diff --git a/kstyle/breezeshadowhelper.h b/kstyle/breezeshadowhelper.h index 61da0fb2..ef950b55 100644 --- a/kstyle/breezeshadowhelper.h +++ b/kstyle/breezeshadowhelper.h @@ -34,12 +34,12 @@ #if BREEZE_HAVE_KWAYLAND namespace KWayland { -namespace Client -{ - class ShadowManager; - class ShmPool; - class Surface; -} + namespace Client + { + class ShadowManager; + class ShmPool; + class Surface; + } } #endif @@ -158,9 +158,6 @@ namespace Breeze //* registered widgets QMap _widgets; - //* registered widgets to wayland surface mappings - QMap _widgetSurfaces; - //* tileset TileSet _shadowTiles; @@ -181,8 +178,13 @@ namespace Breeze #endif #if BREEZE_HAVE_KWAYLAND + + //* registered widgets to wayland surface mappings + QMap _widgetSurfaces; + //* The Wayland shadow manager to create Shadows for Surfaces (QWindow) KWayland::Client::ShadowManager* _shadowManager; + //* The Wayland Shared memory pool to share the shadow pixmaps with compositor KWayland::Client::ShmPool* _shmPool; #endif