Commit 7db2aa9f authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa

Fixed compilation when KWayland is not there.

Differential Revision: https://phabricator.kde.org/D5910
parent 2cc0f8ba
......@@ -1431,6 +1431,7 @@ namespace Breeze
}
//______________________________________________________________________________
bool Helper::isWayland( void )
{
#if QT_VERSION >= 0x050000
......
......@@ -173,28 +173,33 @@ namespace Breeze
{
if( Helper::isWayland() )
{
#if BREEZE_HAVE_KWAYLAND
QWidget* widget( static_cast<QWidget*>( 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();
......
......@@ -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<QWidget*, WId> _widgets;
//* registered widgets to wayland surface mappings
QMap<QWidget*, KWayland::Client::Surface *> _widgetSurfaces;
//* tileset
TileSet _shadowTiles;
......@@ -181,8 +178,13 @@ namespace Breeze
#endif
#if BREEZE_HAVE_KWAYLAND
//* registered widgets to wayland surface mappings
QMap<QWidget*, KWayland::Client::Surface *> _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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment