mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: remove blur behind support leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a467c75b4b
commit
44a2e1d897
22 changed files with 7 additions and 603 deletions
|
@ -355,18 +355,7 @@ void KRunnerDialog::hideEvent(QHideEvent *)
|
||||||
|
|
||||||
void KRunnerDialog::updateMask()
|
void KRunnerDialog::updateMask()
|
||||||
{
|
{
|
||||||
// Enable the mask only when compositing is disabled;
|
setMask(m_background->mask());
|
||||||
// As this operation is quite slow, it would be nice to find some
|
|
||||||
// way to workaround it for no-compositing users.
|
|
||||||
|
|
||||||
if (KWindowSystem::compositingActive()) {
|
|
||||||
clearMask();
|
|
||||||
const QRegion mask = m_background->mask();
|
|
||||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, mask);
|
|
||||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
|
||||||
} else {
|
|
||||||
setMask(m_background->mask());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRunnerDialog::resizeEvent(QResizeEvent *e)
|
void KRunnerDialog::resizeEvent(QResizeEvent *e)
|
||||||
|
|
|
@ -14,7 +14,6 @@ add_subdirectory( demo )
|
||||||
|
|
||||||
set(oxygen_PART_SRCS
|
set(oxygen_PART_SRCS
|
||||||
debug/oxygenwidgetexplorer.cpp
|
debug/oxygenwidgetexplorer.cpp
|
||||||
oxygenblurhelper.cpp
|
|
||||||
oxygenframeshadow.cpp
|
oxygenframeshadow.cpp
|
||||||
oxygenmdiwindowshadow.cpp
|
oxygenmdiwindowshadow.cpp
|
||||||
oxygenmnemonics.cpp
|
oxygenmnemonics.cpp
|
||||||
|
|
|
@ -1,307 +0,0 @@
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
// oxygenblurhelper.cpp
|
|
||||||
// handle regions passed to kwin for blurring
|
|
||||||
// -------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
||||||
//
|
|
||||||
// Loosely inspired (and largely rewritten) from BeSpin style
|
|
||||||
// Copyright (C) 2007 Thomas Luebking <thomas.luebking@web.de>
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
// of this software and associated documentation files (the "Software"), to
|
|
||||||
// deal in the Software without restriction, including without limitation the
|
|
||||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
// sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
// furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
// IN THE SOFTWARE.
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "oxygenblurhelper.h"
|
|
||||||
#include "moc_oxygenblurhelper.cpp"
|
|
||||||
|
|
||||||
#include "oxygenstyleconfigdata.h"
|
|
||||||
|
|
||||||
#include <QtCore/QEvent>
|
|
||||||
#include <QtCore/QVector>
|
|
||||||
#include <QtGui/QProgressBar>
|
|
||||||
#include <QtGui/QPushButton>
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
#include <QtGui/qx11info_x11.h>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Oxygen
|
|
||||||
{
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
BlurHelper::BlurHelper( QObject* parent, StyleHelper& helper ):
|
|
||||||
QObject( parent ),
|
|
||||||
_helper( helper ),
|
|
||||||
_enabled( false )
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
|
|
||||||
// create atom
|
|
||||||
_blurAtom = XInternAtom( QX11Info::display(), "_KDE_NET_WM_BLUR_BEHIND_REGION", False);
|
|
||||||
_opaqueAtom = XInternAtom( QX11Info::display(), "_NET_WM_OPAQUE_REGION", False);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
void BlurHelper::registerWidget( QWidget* widget )
|
|
||||||
{
|
|
||||||
|
|
||||||
// check if already registered
|
|
||||||
if( _widgets.contains( widget ) ) return;
|
|
||||||
|
|
||||||
// install event filter
|
|
||||||
addEventFilter( widget );
|
|
||||||
|
|
||||||
// add to widgets list
|
|
||||||
_widgets.insert( widget );
|
|
||||||
|
|
||||||
// cleanup on destruction
|
|
||||||
connect( widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*)) );
|
|
||||||
|
|
||||||
if( enabled() )
|
|
||||||
{
|
|
||||||
// schedule shadow area repaint
|
|
||||||
_pendingWidgets.insert( widget, widget );
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
void BlurHelper::unregisterWidget( QWidget* widget )
|
|
||||||
{
|
|
||||||
// remove event filter
|
|
||||||
widget->removeEventFilter( this );
|
|
||||||
|
|
||||||
// remove from widgets
|
|
||||||
_widgets.remove( widget );
|
|
||||||
|
|
||||||
if( isTransparent( widget ) ) clear( widget );
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
bool BlurHelper::eventFilter( QObject* object, QEvent* event )
|
|
||||||
{
|
|
||||||
|
|
||||||
// do nothing if not enabled
|
|
||||||
if( !enabled() ) return false;
|
|
||||||
|
|
||||||
switch( event->type() )
|
|
||||||
{
|
|
||||||
|
|
||||||
case QEvent::Hide:
|
|
||||||
{
|
|
||||||
QWidget* widget( qobject_cast<QWidget*>( object ) );
|
|
||||||
if( widget && isOpaque( widget ) && isTransparent( widget->window() ) )
|
|
||||||
{
|
|
||||||
QWidget* window( widget->window() );
|
|
||||||
_pendingWidgets.insert( window, window );
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
case QEvent::Show:
|
|
||||||
case QEvent::Resize:
|
|
||||||
{
|
|
||||||
|
|
||||||
// cast to widget and check
|
|
||||||
QWidget* widget( qobject_cast<QWidget*>( object ) );
|
|
||||||
if( !widget ) break;
|
|
||||||
if( isTransparent( widget ) )
|
|
||||||
{
|
|
||||||
|
|
||||||
_pendingWidgets.insert( widget, widget );
|
|
||||||
update();
|
|
||||||
|
|
||||||
} else if( isOpaque( widget ) ) {
|
|
||||||
|
|
||||||
QWidget* window( widget->window() );
|
|
||||||
if( isTransparent( window ) )
|
|
||||||
{
|
|
||||||
_pendingWidgets.insert( window, window );
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// never eat events
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
QRegion BlurHelper::blurRegion( QWidget* widget ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
if( !widget->isVisible() ) return QRegion();
|
|
||||||
|
|
||||||
// get main region
|
|
||||||
QRegion region;
|
|
||||||
if(
|
|
||||||
qobject_cast<const QDockWidget*>( widget ) ||
|
|
||||||
qobject_cast<const QMenu*>( widget ) ||
|
|
||||||
qobject_cast<const QToolBar*>( widget ) ||
|
|
||||||
widget->inherits( "QComboBoxPrivateContainer" ) )
|
|
||||||
{
|
|
||||||
|
|
||||||
region = _helper.roundedMask( widget->rect() );
|
|
||||||
|
|
||||||
} else region = widget->mask().isEmpty() ? widget->rect():widget->mask();
|
|
||||||
|
|
||||||
|
|
||||||
// trim blur region to remove unnecessary areas
|
|
||||||
trimBlurRegion( widget, widget, region );
|
|
||||||
return region;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
void BlurHelper::trimBlurRegion( QWidget* parent, QWidget* widget, QRegion& region ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
// loop over children
|
|
||||||
foreach( QObject* childObject, widget->children() )
|
|
||||||
{
|
|
||||||
QWidget* child( qobject_cast<QWidget*>( childObject ) );
|
|
||||||
if( !(child && child->isVisible()) ) continue;
|
|
||||||
|
|
||||||
if( isOpaque( child ) )
|
|
||||||
{
|
|
||||||
|
|
||||||
const QPoint offset( child->mapTo( parent, QPoint( 0, 0 ) ) );
|
|
||||||
if( child->mask().isEmpty() )
|
|
||||||
{
|
|
||||||
const QRect rect( child->rect().translated( offset ).adjusted( 1, 1, -1, -1 ) );
|
|
||||||
region -= rect;
|
|
||||||
|
|
||||||
} else region -= child->mask().translated( offset );
|
|
||||||
|
|
||||||
} else { trimBlurRegion( parent, child, region ); }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
void BlurHelper::update( QWidget* widget ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
|
|
||||||
/*
|
|
||||||
directly from bespin code. Supposibly prevent playing with some 'pseudo-widgets'
|
|
||||||
that have winId matching some other -random- window
|
|
||||||
*/
|
|
||||||
if( !(widget->testAttribute(Qt::WA_WState_Created) || widget->internalWinId() ))
|
|
||||||
{ return; }
|
|
||||||
|
|
||||||
const QRegion blurRegion( this->blurRegion( widget ) );
|
|
||||||
const QRegion opaqueRegion = QRegion(0, 0, widget->width(), widget->height()) - blurRegion;
|
|
||||||
if( blurRegion.isEmpty() ) {
|
|
||||||
|
|
||||||
clear( widget );
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
QVector<unsigned long> data;
|
|
||||||
foreach( const QRect& rect, blurRegion.rects() )
|
|
||||||
{ data << rect.x() << rect.y() << rect.width() << rect.height(); }
|
|
||||||
|
|
||||||
XChangeProperty(
|
|
||||||
QX11Info::display(), widget->winId(), _blurAtom, XA_CARDINAL, 32, PropModeReplace,
|
|
||||||
reinterpret_cast<const unsigned char *>(data.constData()), data.size() );
|
|
||||||
|
|
||||||
data.clear();
|
|
||||||
foreach( const QRect& rect, opaqueRegion.rects() )
|
|
||||||
{ data << rect.x() << rect.y() << rect.width() << rect.height(); }
|
|
||||||
|
|
||||||
XChangeProperty(
|
|
||||||
QX11Info::display(), widget->winId(), _opaqueAtom, XA_CARDINAL, 32, PropModeReplace,
|
|
||||||
reinterpret_cast<const unsigned char *>(data.constData()), data.size() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// force update
|
|
||||||
if( widget->isVisible() )
|
|
||||||
{ widget->update(); }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
void BlurHelper::clear( QWidget* widget ) const
|
|
||||||
{
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
XDeleteProperty( QX11Info::display(), widget->winId(), _blurAtom );
|
|
||||||
XDeleteProperty( QX11Info::display(), widget->winId(), _opaqueAtom );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
bool BlurHelper::isOpaque( const QWidget* widget ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
return
|
|
||||||
(!widget->isWindow()) &&
|
|
||||||
( (widget->autoFillBackground() && widget->palette().color( widget->backgroundRole() ).alpha() == 0xff ) ||
|
|
||||||
widget->testAttribute(Qt::WA_OpaquePaintEvent) );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//___________________________________________________________
|
|
||||||
bool BlurHelper::isTransparent( const QWidget* widget ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
return
|
|
||||||
widget->isWindow() &&
|
|
||||||
widget->testAttribute( Qt::WA_TranslucentBackground ) &&
|
|
||||||
|
|
||||||
// widgets using qgraphicsview
|
|
||||||
!( widget->graphicsProxyWidget() ||
|
|
||||||
widget->inherits( "Plasma::Dialog" ) ) &&
|
|
||||||
|
|
||||||
// flags and special widgets
|
|
||||||
( widget->testAttribute( Qt::WA_StyledBackground ) ||
|
|
||||||
qobject_cast<const QMenu*>( widget ) ||
|
|
||||||
qobject_cast<const QDockWidget*>( widget ) ||
|
|
||||||
qobject_cast<const QToolBar*>( widget ) ||
|
|
||||||
widget->windowType() == Qt::ToolTip ) &&
|
|
||||||
_helper.hasAlphaChannel( widget );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,172 +0,0 @@
|
||||||
#ifndef OXYGENBLURHELPER_H
|
|
||||||
#define OXYGENBLURHELPER_H
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
// oxygenblurhelper.h
|
|
||||||
// handle regions passed to kwin for blurring
|
|
||||||
// -------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
||||||
//
|
|
||||||
// Loosely inspired (and largely rewritten) from BeSpin style
|
|
||||||
// Copyright (C) 2007 Thomas Luebking <thomas.luebking@web.de>
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
// of this software and associated documentation files (the "Software"), to
|
|
||||||
// deal in the Software without restriction, including without limitation the
|
|
||||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
// sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
// furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
// IN THE SOFTWARE.
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "oxygenstylehelper.h"
|
|
||||||
|
|
||||||
#include <QtCore/QBasicTimer>
|
|
||||||
#include <QtCore/QHash>
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QPointer>
|
|
||||||
#include <QtCore/QSet>
|
|
||||||
#include <QtCore/qcoreevent.h>
|
|
||||||
|
|
||||||
#include <QtGui/QDockWidget>
|
|
||||||
#include <QtGui/QMenu>
|
|
||||||
#include <QtGui/QRegion>
|
|
||||||
#include <QtGui/QToolBar>
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
#include <X11/Xdefs.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Oxygen
|
|
||||||
{
|
|
||||||
class BlurHelper: public QObject
|
|
||||||
{
|
|
||||||
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//! constructor
|
|
||||||
BlurHelper( QObject*, StyleHelper& );
|
|
||||||
|
|
||||||
//! destructor
|
|
||||||
virtual ~BlurHelper( void )
|
|
||||||
{}
|
|
||||||
|
|
||||||
//! enable state
|
|
||||||
void setEnabled( bool value )
|
|
||||||
{ _enabled = value; }
|
|
||||||
|
|
||||||
//! enabled
|
|
||||||
bool enabled( void ) const
|
|
||||||
{ return _enabled; }
|
|
||||||
|
|
||||||
//! register widget
|
|
||||||
void registerWidget( QWidget* );
|
|
||||||
|
|
||||||
//! register widget
|
|
||||||
void unregisterWidget( QWidget* );
|
|
||||||
|
|
||||||
//! event filter
|
|
||||||
virtual bool eventFilter( QObject*, QEvent* );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//! timer event
|
|
||||||
/*! used to perform delayed blur region update of pending widgets */
|
|
||||||
virtual void timerEvent( QTimerEvent* event )
|
|
||||||
{
|
|
||||||
|
|
||||||
if( event->timerId() == _timer.timerId() )
|
|
||||||
{
|
|
||||||
_timer.stop();
|
|
||||||
update();
|
|
||||||
} else QObject::timerEvent( event );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//! install event filter to object, in a unique way
|
|
||||||
void addEventFilter( QObject* object )
|
|
||||||
{
|
|
||||||
object->removeEventFilter( this );
|
|
||||||
object->installEventFilter( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
//! get list of blur-behind regions matching a given widget
|
|
||||||
QRegion blurRegion( QWidget* ) const;
|
|
||||||
|
|
||||||
//! trim blur region to remove unnecessary areas (recursive)
|
|
||||||
void trimBlurRegion( QWidget*, QWidget*, QRegion& ) const;
|
|
||||||
|
|
||||||
//! update blur region for all pending widgets
|
|
||||||
void update( void )
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach( const WidgetPointer& widget, _pendingWidgets )
|
|
||||||
{ if( widget ) update( widget.data() ); }
|
|
||||||
|
|
||||||
_pendingWidgets.clear();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//! update blur regions for given widget
|
|
||||||
void update( QWidget* ) const;
|
|
||||||
|
|
||||||
//! clear blur regions for given widget
|
|
||||||
void clear( QWidget* ) const;
|
|
||||||
|
|
||||||
//! returns true if a given widget is opaque
|
|
||||||
bool isOpaque( const QWidget* widget ) const;
|
|
||||||
|
|
||||||
//! true if widget is a transparent window
|
|
||||||
/*! some additional checks are performed to make sure stuff like plasma tooltips
|
|
||||||
don't get their blur region overwritten */
|
|
||||||
bool isTransparent( const QWidget* widget ) const;
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
|
|
||||||
//! wiget destroyed
|
|
||||||
void widgetDestroyed( QObject* object )
|
|
||||||
{ _widgets.remove( object ); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
//! helper
|
|
||||||
StyleHelper& _helper;
|
|
||||||
|
|
||||||
//! enability
|
|
||||||
bool _enabled;
|
|
||||||
|
|
||||||
//! list of widgets for which blur region must be updated
|
|
||||||
typedef QPointer<QWidget> WidgetPointer;
|
|
||||||
typedef QHash<QWidget*, WidgetPointer> WidgetSet;
|
|
||||||
WidgetSet _pendingWidgets;
|
|
||||||
|
|
||||||
//! set of registered widgets
|
|
||||||
QSet<const QObject*> _widgets;
|
|
||||||
|
|
||||||
//! delayed update timer
|
|
||||||
QBasicTimer _timer;
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
//! blur atom
|
|
||||||
Atom _blurAtom;
|
|
||||||
Atom _opaqueAtom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -49,7 +49,6 @@
|
||||||
#include "oxygenstyle.h"
|
#include "oxygenstyle.h"
|
||||||
#include "moc_oxygenstyle.cpp"
|
#include "moc_oxygenstyle.cpp"
|
||||||
|
|
||||||
#include "oxygenblurhelper.h"
|
|
||||||
#include "oxygenframeshadow.h"
|
#include "oxygenframeshadow.h"
|
||||||
#include "oxygenmdiwindowshadow.h"
|
#include "oxygenmdiwindowshadow.h"
|
||||||
#include "oxygenmnemonics.h"
|
#include "oxygenmnemonics.h"
|
||||||
|
@ -168,7 +167,6 @@ namespace Oxygen
|
||||||
_frameShadowFactory( new FrameShadowFactory( this ) ),
|
_frameShadowFactory( new FrameShadowFactory( this ) ),
|
||||||
_mdiWindowShadowFactory( new MdiWindowShadowFactory( this, *_helper ) ),
|
_mdiWindowShadowFactory( new MdiWindowShadowFactory( this, *_helper ) ),
|
||||||
_mnemonics( new Mnemonics( this ) ),
|
_mnemonics( new Mnemonics( this ) ),
|
||||||
_blurHelper( new BlurHelper( this, helper() ) ),
|
|
||||||
_widgetExplorer( new WidgetExplorer( this ) ),
|
_widgetExplorer( new WidgetExplorer( this ) ),
|
||||||
_tabBarData( new TabBarData( this ) ),
|
_tabBarData( new TabBarData( this ) ),
|
||||||
_frameFocusPrimitive( 0 ),
|
_frameFocusPrimitive( 0 ),
|
||||||
|
@ -442,7 +440,6 @@ namespace Oxygen
|
||||||
frameShadowFactory().unregisterWidget( widget );
|
frameShadowFactory().unregisterWidget( widget );
|
||||||
mdiWindowShadowFactory().unregisterWidget( widget );
|
mdiWindowShadowFactory().unregisterWidget( widget );
|
||||||
shadowHelper().unregisterWidget( widget );
|
shadowHelper().unregisterWidget( widget );
|
||||||
blurHelper().unregisterWidget( widget );
|
|
||||||
|
|
||||||
if( isKTextEditFrame( widget ) )
|
if( isKTextEditFrame( widget ) )
|
||||||
{ widget->setAttribute( Qt::WA_Hover, false ); }
|
{ widget->setAttribute( Qt::WA_Hover, false ); }
|
||||||
|
@ -3357,8 +3354,6 @@ namespace Oxygen
|
||||||
const bool hasAlpha( helper().hasAlphaChannel( widget ) );
|
const bool hasAlpha( helper().hasAlphaChannel( widget ) );
|
||||||
if( hasAlpha && StyleConfigData::toolTipTransparent() )
|
if( hasAlpha && StyleConfigData::toolTipTransparent() )
|
||||||
{
|
{
|
||||||
if( widget && widget->window() )
|
|
||||||
{ blurHelper().registerWidget( widget->window() ); }
|
|
||||||
topColor.setAlpha( 220 );
|
topColor.setAlpha( 220 );
|
||||||
bottomColor.setAlpha( 220 );
|
bottomColor.setAlpha( 220 );
|
||||||
}
|
}
|
||||||
|
@ -7390,9 +7385,6 @@ namespace Oxygen
|
||||||
|
|
||||||
helper().setMaxCacheSize( cacheSize );
|
helper().setMaxCacheSize( cacheSize );
|
||||||
|
|
||||||
// always enable blur helper
|
|
||||||
blurHelper().setEnabled( true );
|
|
||||||
|
|
||||||
// reinitialize engines
|
// reinitialize engines
|
||||||
windowManager().initialize();
|
windowManager().initialize();
|
||||||
shadowHelper().reloadConfig();
|
shadowHelper().reloadConfig();
|
||||||
|
|
|
@ -76,7 +76,6 @@ namespace Oxygen
|
||||||
class Transitions;
|
class Transitions;
|
||||||
class WindowManager;
|
class WindowManager;
|
||||||
class WidgetExplorer;
|
class WidgetExplorer;
|
||||||
class BlurHelper;
|
|
||||||
|
|
||||||
//! toplevel manager
|
//! toplevel manager
|
||||||
class TopLevelManager: public QObject
|
class TopLevelManager: public QObject
|
||||||
|
@ -355,10 +354,6 @@ namespace Oxygen
|
||||||
MdiWindowShadowFactory& mdiWindowShadowFactory( void ) const
|
MdiWindowShadowFactory& mdiWindowShadowFactory( void ) const
|
||||||
{ return *_mdiWindowShadowFactory; }
|
{ return *_mdiWindowShadowFactory; }
|
||||||
|
|
||||||
//! blur helper
|
|
||||||
BlurHelper& blurHelper( void ) const
|
|
||||||
{ return *_blurHelper; }
|
|
||||||
|
|
||||||
//! mdi window shadows
|
//! mdi window shadows
|
||||||
Mnemonics& mnemonics( void ) const
|
Mnemonics& mnemonics( void ) const
|
||||||
{ return *_mnemonics; }
|
{ return *_mnemonics; }
|
||||||
|
@ -839,9 +834,6 @@ namespace Oxygen
|
||||||
//! keyboard accelerators
|
//! keyboard accelerators
|
||||||
Mnemonics* _mnemonics;
|
Mnemonics* _mnemonics;
|
||||||
|
|
||||||
//! blur helper
|
|
||||||
BlurHelper* _blurHelper;
|
|
||||||
|
|
||||||
//! widget explorer
|
//! widget explorer
|
||||||
WidgetExplorer* _widgetExplorer;
|
WidgetExplorer* _widgetExplorer;
|
||||||
|
|
||||||
|
|
|
@ -202,8 +202,6 @@ bool AuroraeFactory::supports(Ability ability) const
|
||||||
return true; // TODO: correct value from theme
|
return true; // TODO: correct value from theme
|
||||||
case AbilityTabbing:
|
case AbilityTabbing:
|
||||||
return false;
|
return false;
|
||||||
case AbilityUsesBlurBehind:
|
|
||||||
return true;
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,14 +107,6 @@ bool DecorationPlugin::supportsFrameOverlap() const
|
||||||
return factory()->supports(AbilityExtendIntoClientArea);
|
return factory()->supports(AbilityExtendIntoClientArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DecorationPlugin::supportsBlurBehind() const
|
|
||||||
{
|
|
||||||
if (m_disabled) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return factory()->supports(AbilityUsesBlurBehind);
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt::Corner DecorationPlugin::closeButtonCorner()
|
Qt::Corner DecorationPlugin::closeButtonCorner()
|
||||||
{
|
{
|
||||||
if (m_disabled) {
|
if (m_disabled) {
|
||||||
|
@ -156,8 +148,6 @@ QString DecorationPlugin::supportInformation()
|
||||||
support.append("Frame Overlap: ");
|
support.append("Frame Overlap: ");
|
||||||
support.append(supportsFrameOverlap() ? "yes\n" : "no\n");
|
support.append(supportsFrameOverlap() ? "yes\n" : "no\n");
|
||||||
|
|
||||||
support.append("Blur Behind: ");
|
|
||||||
support.append(supportsBlurBehind() ? "yes\n" : "no\n");
|
|
||||||
// TODO: Qt5 - read support information from Factory
|
// TODO: Qt5 - read support information from Factory
|
||||||
return support;
|
return support;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ public:
|
||||||
bool supportsAnnounceAlpha() const;
|
bool supportsAnnounceAlpha() const;
|
||||||
bool supportsTabbing() const;
|
bool supportsTabbing() const;
|
||||||
bool supportsFrameOverlap() const;
|
bool supportsFrameOverlap() const;
|
||||||
bool supportsBlurBehind() const;
|
|
||||||
Qt::Corner closeButtonCorner();
|
Qt::Corner closeButtonCorner();
|
||||||
|
|
||||||
QString supportInformation();
|
QString supportInformation();
|
||||||
|
|
|
@ -485,16 +485,6 @@ bool EffectsHandlerImpl::hasDecorationShadows() const
|
||||||
return decorationPlugin()->hasShadows();
|
return decorationPlugin()->hasShadows();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EffectsHandlerImpl::decorationsHaveAlpha() const
|
|
||||||
{
|
|
||||||
return decorationPlugin()->hasAlpha();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EffectsHandlerImpl::decorationSupportsBlurBehind() const
|
|
||||||
{
|
|
||||||
return decorationPlugin()->supportsBlurBehind();
|
|
||||||
}
|
|
||||||
|
|
||||||
// start another painting pass
|
// start another painting pass
|
||||||
void EffectsHandlerImpl::startPaint()
|
void EffectsHandlerImpl::startPaint()
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,10 +161,6 @@ public:
|
||||||
|
|
||||||
virtual bool hasDecorationShadows() const;
|
virtual bool hasDecorationShadows() const;
|
||||||
|
|
||||||
virtual bool decorationsHaveAlpha() const;
|
|
||||||
|
|
||||||
virtual bool decorationSupportsBlurBehind() const;
|
|
||||||
|
|
||||||
virtual EffectFrame* effectFrame(bool staticSize, const QPoint& position, Qt::Alignment alignment) const;
|
virtual EffectFrame* effectFrame(bool staticSize, const QPoint& position, Qt::Alignment alignment) const;
|
||||||
|
|
||||||
virtual QVariant kwinOption(KWinOption kwopt);
|
virtual QVariant kwinOption(KWinOption kwopt);
|
||||||
|
|
|
@ -212,13 +212,11 @@ public:
|
||||||
/// region, when the blur plugin is enabled.
|
/// region, when the blur plugin is enabled.
|
||||||
/// @since 4.3
|
/// @since 4.3
|
||||||
AbilityExtendIntoClientArea = 13, ///< The decoration respects transparentRect()
|
AbilityExtendIntoClientArea = 13, ///< The decoration respects transparentRect()
|
||||||
/// @since 4.4
|
|
||||||
AbilityUsesBlurBehind = 14, ///< The decoration wants the background to be blurred, when the blur plugin is enabled.
|
|
||||||
/// @since 4.6
|
/// @since 4.6
|
||||||
AbilityAnnounceAlphaChannel = 15, ///< The decoration can tell whether it currently uses an alpha channel or not. Requires AbilityUsesAlphaChannel.
|
AbilityAnnounceAlphaChannel = 14, ///< The decoration can tell whether it currently uses an alpha channel or not. Requires AbilityUsesAlphaChannel.
|
||||||
/// @since 4.10
|
/// @since 4.10
|
||||||
// Tabbing
|
// Tabbing
|
||||||
AbilityTabbing = 16, ///< The decoration supports tabbing
|
AbilityTabbing = 15, ///< The decoration supports tabbing
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -601,14 +601,6 @@ class KWIN_EXPORT EffectsHandler : public QObject
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(qreal animationTimeFactor READ animationTimeFactor)
|
Q_PROPERTY(qreal animationTimeFactor READ animationTimeFactor)
|
||||||
Q_PROPERTY(QList< KWin::EffectWindow* > stackingOrder READ stackingOrder)
|
Q_PROPERTY(QList< KWin::EffectWindow* > stackingOrder READ stackingOrder)
|
||||||
/**
|
|
||||||
* Whether window decorations use the alpha channel.
|
|
||||||
**/
|
|
||||||
Q_PROPERTY(bool decorationsHaveAlpha READ decorationsHaveAlpha)
|
|
||||||
/**
|
|
||||||
* Whether the window decorations support blurring behind the decoration.
|
|
||||||
**/
|
|
||||||
Q_PROPERTY(bool decorationSupportsBlurBehind READ decorationSupportsBlurBehind)
|
|
||||||
Q_PROPERTY(CompositingType compositingType READ compositingType CONSTANT)
|
Q_PROPERTY(CompositingType compositingType READ compositingType CONSTANT)
|
||||||
Q_PROPERTY(QPoint cursorPos READ cursorPos)
|
Q_PROPERTY(QPoint cursorPos READ cursorPos)
|
||||||
friend class Effect;
|
friend class Effect;
|
||||||
|
@ -844,18 +836,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool hasDecorationShadows() const = 0;
|
virtual bool hasDecorationShadows() const = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns @a true if the window decorations use the alpha channel, and @a false otherwise.
|
|
||||||
* @since 4.5
|
|
||||||
*/
|
|
||||||
virtual bool decorationsHaveAlpha() const = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns @a true if the window decorations support blurring behind the decoration, and @a false otherwise
|
|
||||||
* @since 4.6
|
|
||||||
*/
|
|
||||||
virtual bool decorationSupportsBlurBehind() const = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new frame object. If the frame does not have a static size
|
* Creates a new frame object. If the frame does not have a static size
|
||||||
* then it will be located at @a position with @a alignment. A
|
* then it will be located at @a position with @a alignment. A
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <Plasma/Applet>
|
#include <Plasma/Applet>
|
||||||
#include <Plasma/FrameSvg>
|
#include <Plasma/FrameSvg>
|
||||||
#include <Plasma/WindowEffects>
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
# include <qx11info_x11.h>
|
# include <qx11info_x11.h>
|
||||||
|
@ -45,13 +44,7 @@ Dialog::Dialog(QWidget *parent)
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
setAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu);
|
setAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu);
|
||||||
|
setAttribute(Qt::WA_NoSystemBackground, KWindowSystem::compositingActive());
|
||||||
if (KWindowSystem::compositingActive()) {
|
|
||||||
setAttribute(Qt::WA_NoSystemBackground, false);
|
|
||||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
|
||||||
} else {
|
|
||||||
setAttribute(Qt::WA_NoSystemBackground);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KWindowSystem::setState(effectiveWinId(), NET::SkipTaskbar | NET::SkipPager);
|
KWindowSystem::setState(effectiveWinId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
|
@ -156,11 +149,7 @@ void Dialog::resizeEvent(QResizeEvent *event)
|
||||||
m_background->resizeFrame(rect().size());
|
m_background->resizeFrame(rect().size());
|
||||||
m_view->setGeometry(contentsRect());
|
m_view->setGeometry(contentsRect());
|
||||||
|
|
||||||
if (KWindowSystem::compositingActive()) {
|
setMask(m_background->mask());
|
||||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, m_background->mask());
|
|
||||||
} else {
|
|
||||||
setMask(m_background->mask());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::paintEvent(QPaintEvent *event)
|
void Dialog::paintEvent(QPaintEvent *event)
|
||||||
|
|
|
@ -89,7 +89,6 @@ PopupView::PopupView(const QModelIndex &index, const QPoint &pos,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
KWindowSystem::setState(effectiveWinId(), NET::SkipTaskbar | NET::SkipPager);
|
KWindowSystem::setState(effectiveWinId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
@ -138,8 +137,6 @@ PopupView::PopupView(const QModelIndex &index, const QPoint &pos,
|
||||||
pt.ry() = available.top();
|
pt.ry() = available.top();
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
|
||||||
|
|
||||||
move(pt);
|
move(pt);
|
||||||
show();
|
show();
|
||||||
|
|
||||||
|
@ -530,11 +527,7 @@ void PopupView::resizeEvent(QResizeEvent *event)
|
||||||
m_view->setGeometry(contentsRect());
|
m_view->setGeometry(contentsRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KWindowSystem::compositingActive()) {
|
setMask(m_background->mask());
|
||||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, m_background->mask());
|
|
||||||
} else {
|
|
||||||
setMask(m_background->mask());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupView::showEvent(QShowEvent *event)
|
void PopupView::showEvent(QShowEvent *event)
|
||||||
|
|
|
@ -588,7 +588,6 @@ void Panel::paintInterface(QPainter *painter,
|
||||||
if (containmentOpt && containmentOpt->view && !m_background->mask().isEmpty()) {
|
if (containmentOpt && containmentOpt->view && !m_background->mask().isEmpty()) {
|
||||||
const QRegion mask = m_background->mask();
|
const QRegion mask = m_background->mask();
|
||||||
containmentOpt->view->setMask(mask);
|
containmentOpt->view->setMask(mask);
|
||||||
Plasma::WindowEffects::enableBlurBehind(containmentOpt->view->winId(), true, mask);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ bool WeatherEngine::updateSourceEvent(const QString& source)
|
||||||
|
|
||||||
void WeatherEngine::networkStatusChanged(Solid::Networking::Status status)
|
void WeatherEngine::networkStatusChanged(Solid::Networking::Status status)
|
||||||
{
|
{
|
||||||
kDebug();
|
kDebug() << status;
|
||||||
m_networkAvailable = status == Solid::Networking::Connected || status == Solid::Networking::Unknown;
|
m_networkAvailable = status == Solid::Networking::Connected || status == Solid::Networking::Unknown;
|
||||||
if (m_networkAvailable) {
|
if (m_networkAvailable) {
|
||||||
// allow the network to settle down and actually come up
|
// allow the network to settle down and actually come up
|
||||||
|
|
|
@ -69,7 +69,6 @@ ControllerWindow::ControllerWindow(QWidget* parent)
|
||||||
pal.setBrush(backgroundRole(), Qt::transparent);
|
pal.setBrush(backgroundRole(), Qt::transparent);
|
||||||
setPalette(pal);
|
setPalette(pal);
|
||||||
|
|
||||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
|
||||||
m_panelShadow = new PanelShadows(this);
|
m_panelShadow = new PanelShadows(this);
|
||||||
m_panelShadow->setImagePath("dialogs/background");
|
m_panelShadow->setImagePath("dialogs/background");
|
||||||
|
|
||||||
|
@ -486,8 +485,6 @@ void ControllerWindow::resizeEvent(QResizeEvent * event)
|
||||||
{
|
{
|
||||||
m_background->resizeFrame(size());
|
m_background->resizeFrame(size());
|
||||||
|
|
||||||
Plasma::WindowEffects::enableBlurBehind(effectiveWinId(), true, m_background->mask());
|
|
||||||
|
|
||||||
// qDebug() << "ControllerWindow::resizeEvent" << event->oldSize();
|
// qDebug() << "ControllerWindow::resizeEvent" << event->oldSize();
|
||||||
|
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
|
|
|
@ -162,7 +162,6 @@ int PlasmaApp::newInstance()
|
||||||
view->viewport()->setAutoFillBackground(false);
|
view->viewport()->setAutoFillBackground(false);
|
||||||
view->setAttribute(Qt::WA_NoSystemBackground);
|
view->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
|
view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
Plasma::WindowEffects::overrideShadow(view->winId(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args->isSet("fullscreen")) {
|
if (args->isSet("fullscreen")) {
|
||||||
|
|
|
@ -149,16 +149,6 @@ void SingleView::updateGeometry()
|
||||||
|
|
||||||
setSceneRect(m_applet->sceneBoundingRect());
|
setSceneRect(m_applet->sceneBoundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((windowFlags() & Qt::FramelessWindowHint) &&
|
|
||||||
applet()->backgroundHints() != Plasma::Applet::NoBackground) {
|
|
||||||
|
|
||||||
// TODO: Use the background's mask for blur
|
|
||||||
QRegion mask;
|
|
||||||
mask += QRect(QPoint(), size());
|
|
||||||
|
|
||||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, mask);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_singleview.cpp"
|
#include "moc_singleview.cpp"
|
||||||
|
|
|
@ -55,10 +55,4 @@ void KToolTipWindow::paintEvent(QPaintEvent* event)
|
||||||
QWidget::paintEvent(event);
|
QWidget::paintEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KToolTipWindow::showEvent(QShowEvent *)
|
|
||||||
{
|
|
||||||
Plasma::WindowEffects::overrideShadow(winId(), true);
|
|
||||||
Plasma::WindowEffects::enableBlurBehind(winId(), true, mask());
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "moc_ktooltipwindow_p.cpp"
|
#include "moc_ktooltipwindow_p.cpp"
|
||||||
|
|
|
@ -34,7 +34,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void paintEvent(QPaintEvent* event);
|
virtual void paintEvent(QPaintEvent* event);
|
||||||
virtual void showEvent(QShowEvent *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue