summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Pereira Da Costa <hugo.pereira.da.costa@gmail.com>2017-06-07 07:36:44 (GMT)
committerHugo Pereira Da Costa <hugo.pereira.da.costa@gmail.com>2017-06-07 07:36:44 (GMT)
commit7db2aa9fcddd7d06c48d392bff05c1033d8241e3 (patch)
tree781610bb1beae1ce2daba73c14fe22b4d10d6d8f
parent2cc0f8ba2da50ca3efa500ebdcc3655c8d0e47f8 (diff)
Fixed compilation when KWayland is not there.
Differential Revision: https://phabricator.kde.org/D5910
-rw-r--r--kstyle/breezehelper.cpp1
-rw-r--r--kstyle/breezeshadowhelper.cpp18
-rw-r--r--kstyle/breezeshadowhelper.h20
3 files changed, 23 insertions, 16 deletions
diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp
index f55b4b4..1fd39a5 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 32859f4..5226f1d 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<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();
diff --git a/kstyle/breezeshadowhelper.h b/kstyle/breezeshadowhelper.h
index 61da0fb..ef950b5 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<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