Commit a4131c5d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[kstyle] create shadow tiles more explicitly

Summary:
With this changes it's more clear where shadow tiles are created, also it
fixes one possible bug. For example, right now, there are two shady actors
who trigger creation of the shadow tiles:

* the first one lays inside of Style::loadConfiguration(). It creates
shadow tiles as a side effect of configuration of _mdiWindowShadowFactory
* the second one lays inside of ShadowHelper::createPixmapHandles()

Please note, ShadowHelper::createPixmapHandles() is invoked only for X11 not Wayland!

Reviewers: #breeze, hpereiradacosta

Reviewed By: hpereiradacosta

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11533
parent 2983e639
......@@ -179,6 +179,9 @@ namespace Breeze
// reset
reset();
// create shadow tiles
shadowTiles();
// update property for registered widgets
for( QMap<QWidget*,WId>::const_iterator iter = _widgets.constBegin(); iter != _widgets.constEnd(); ++iter )
{ installShadows( iter.key() ); }
......@@ -360,10 +363,8 @@ namespace Breeze
if( !_atom && Helper::isX11() ) _atom = _helper.createAtom( QLatin1String( netWMShadowAtomName ) );
#endif
shadowTiles();
// make sure size is valid
if( _pixmaps.empty() && _shadowTiles.isValid() )
if( _pixmaps.empty() )
{
_pixmaps.append( createPixmap( _shadowTiles.pixmap( 1 ) ) );
......@@ -427,7 +428,7 @@ namespace Breeze
//_______________________________________________________
bool ShadowHelper::installShadows( QWidget* widget )
{
if( !widget ) return false;
if( !widget || !_shadowTiles.isValid() ) return false;
/*
From bespin code. Supposibly prevent playing with some 'pseudo-widgets'
......@@ -485,8 +486,6 @@ namespace Breeze
if( widget->windowHandle()->parent() ) return false;
if( !_shadowManager || !_shmPool ) return false;
if( !_shadowTiles.isValid() ) return false;
// create shadow
using namespace KWayland::Client;
auto s = Surface::fromWindow( widget->windowHandle() );
......
Supports Markdown
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