Use kwinrc:[Translucency]:UseTranslucency for controlling compositing.
svn path=/branches/work/kwin_composite/; revision=558712
This commit is contained in:
parent
a3e8749d1c
commit
bab62bf88f
5 changed files with 21 additions and 12 deletions
|
@ -26,6 +26,8 @@ namespace KWinInternal
|
||||||
#if defined( HAVE_XCOMPOSITE ) && defined( HAVE_XDAMAGE ) && defined( HAVE_XFIXES )
|
#if defined( HAVE_XCOMPOSITE ) && defined( HAVE_XDAMAGE ) && defined( HAVE_XFIXES )
|
||||||
void Workspace::setupCompositing()
|
void Workspace::setupCompositing()
|
||||||
{
|
{
|
||||||
|
if( !options->useTranslucency )
|
||||||
|
return;
|
||||||
if( !Extensions::compositeAvailable() || !Extensions::damageAvailable())
|
if( !Extensions::compositeAvailable() || !Extensions::damageAvailable())
|
||||||
return;
|
return;
|
||||||
if( scene != NULL )
|
if( scene != NULL )
|
||||||
|
@ -36,12 +38,20 @@ void Workspace::setupCompositing()
|
||||||
// scene = new SceneBasic( this );
|
// scene = new SceneBasic( this );
|
||||||
scene = new SceneXrender( this );
|
scene = new SceneXrender( this );
|
||||||
addDamage( 0, 0, displayWidth(), displayHeight());
|
addDamage( 0, 0, displayWidth(), displayHeight());
|
||||||
|
foreach( Client* c, clients )
|
||||||
|
c->setupCompositing();
|
||||||
|
foreach( Unmanaged* c, unmanaged )
|
||||||
|
c->setupCompositing();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::finishCompositing()
|
void Workspace::finishCompositing()
|
||||||
{
|
{
|
||||||
if( scene == NULL )
|
if( scene == NULL )
|
||||||
return;
|
return;
|
||||||
|
foreach( Client* c, clients )
|
||||||
|
c->finishCompositing();
|
||||||
|
foreach( Unmanaged* c, unmanaged )
|
||||||
|
c->finishCompositing();
|
||||||
XCompositeUnredirectSubwindows( display(), rootWindow(), CompositeRedirectManual );
|
XCompositeUnredirectSubwindows( display(), rootWindow(), CompositeRedirectManual );
|
||||||
compositeTimer.stop();
|
compositeTimer.stop();
|
||||||
// TODO stop tracking unmanaged windows
|
// TODO stop tracking unmanaged windows
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <kmessagebox.h>
|
#include <kmessagebox.h>
|
||||||
|
|
||||||
#include <qlabel.h>
|
#include <kactivelabel.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <kcolorbutton.h>
|
#include <kcolorbutton.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
|
@ -1244,7 +1244,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
||||||
QVBoxLayout *lay = new QVBoxLayout (this);
|
QVBoxLayout *lay = new QVBoxLayout (this);
|
||||||
kompmgrAvailable_ = kompmgrAvailable();
|
kompmgrAvailable_ = kompmgrAvailable();
|
||||||
if (!kompmgrAvailable_){
|
if (!kompmgrAvailable_){
|
||||||
QLabel *label = new QLabel(i18n("<qt><b>It seems that alpha channel support is not available.</b><br><br>"
|
KActiveLabel *label = new KActiveLabel(i18n("<qt><b>It seems that alpha channel support is not available.</b><br><br>"
|
||||||
"Please make sure you have "
|
"Please make sure you have "
|
||||||
"<a href=\"http://www.freedesktop.org/\">Xorg ≥ 6.8</a>,"
|
"<a href=\"http://www.freedesktop.org/\">Xorg ≥ 6.8</a>,"
|
||||||
" and have installed the kompmgr that came with kwin.<br>"
|
" and have installed the kompmgr that came with kwin.<br>"
|
||||||
|
@ -1255,7 +1255,6 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
||||||
"And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):<br><br>"
|
"And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):<br><br>"
|
||||||
"<i>Option \"RenderAccel\" \"true\"</i><br>"
|
"<i>Option \"RenderAccel\" \"true\"</i><br>"
|
||||||
"In <i>Section \"Device\"</i></qt>"), this);
|
"In <i>Section \"Device\"</i></qt>"), this);
|
||||||
label->setOpenExternalLinks(true);
|
|
||||||
lay->addWidget(label);
|
lay->addWidget(label);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1476,10 +1475,8 @@ void KTranslucencyConfig::load( void )
|
||||||
|
|
||||||
if (!kompmgrAvailable_)
|
if (!kompmgrAvailable_)
|
||||||
return;
|
return;
|
||||||
config->setGroup( "Notification Messages" );
|
|
||||||
useTranslucency->setChecked(config->readEntry("UseTranslucency", QVariant(false)).toBool());
|
|
||||||
|
|
||||||
config->setGroup( "Translucency" );
|
config->setGroup( "Translucency" );
|
||||||
|
useTranslucency->setChecked(config->readEntry("UseTranslucency", QVariant(false)).toBool());
|
||||||
activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool());
|
activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool());
|
||||||
inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", QVariant(true)).toBool());
|
inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", QVariant(true)).toBool());
|
||||||
movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool());
|
movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool());
|
||||||
|
@ -1539,10 +1536,8 @@ void KTranslucencyConfig::save( void )
|
||||||
{
|
{
|
||||||
if (!kompmgrAvailable_)
|
if (!kompmgrAvailable_)
|
||||||
return;
|
return;
|
||||||
config->setGroup( "Notification Messages" );
|
|
||||||
config->writeEntry("UseTranslucency",useTranslucency->isChecked());
|
|
||||||
|
|
||||||
config->setGroup( "Translucency" );
|
config->setGroup( "Translucency" );
|
||||||
|
config->writeEntry("UseTranslucency",useTranslucency->isChecked());
|
||||||
config->writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked());
|
config->writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked());
|
||||||
config->writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked());
|
config->writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked());
|
||||||
config->writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked());
|
config->writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked());
|
||||||
|
|
|
@ -174,9 +174,8 @@ unsigned long Options::updateSettings()
|
||||||
CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel","Nothing"));
|
CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel","Nothing"));
|
||||||
|
|
||||||
//translucency settings - TODO
|
//translucency settings - TODO
|
||||||
config->setGroup( "Notification Messages" );
|
|
||||||
useTranslucency = config->readEntry("UseTranslucency", QVariant(false)).toBool();
|
|
||||||
config->setGroup( "Translucency");
|
config->setGroup( "Translucency");
|
||||||
|
useTranslucency = config->readEntry("UseTranslucency", QVariant(true)).toBool();
|
||||||
translucentActiveWindows = config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool();
|
translucentActiveWindows = config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool();
|
||||||
activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
|
activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
|
||||||
translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", QVariant(false)).toBool();
|
translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", QVariant(false)).toBool();
|
||||||
|
|
|
@ -42,9 +42,9 @@ class Toplevel
|
||||||
Pixmap windowPixmap() const;
|
Pixmap windowPixmap() const;
|
||||||
Visual* visual() const;
|
Visual* visual() const;
|
||||||
virtual float opacity() const = 0;
|
virtual float opacity() const = 0;
|
||||||
protected:
|
|
||||||
void setupCompositing();
|
void setupCompositing();
|
||||||
void finishCompositing();
|
void finishCompositing();
|
||||||
|
protected:
|
||||||
void setHandle( Window id );
|
void setHandle( Window id );
|
||||||
void resetWindowPixmap();
|
void resetWindowPixmap();
|
||||||
void damageNotifyEvent( XDamageNotifyEvent* e );
|
void damageNotifyEvent( XDamageNotifyEvent* e );
|
||||||
|
|
|
@ -961,6 +961,11 @@ void Workspace::slotReconfigure()
|
||||||
updateTopMenuGeometry();
|
updateTopMenuGeometry();
|
||||||
updateCurrentTopMenu();
|
updateCurrentTopMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( options->useTranslucency )
|
||||||
|
setupCompositing();
|
||||||
|
else
|
||||||
|
finishCompositing();
|
||||||
|
|
||||||
loadWindowRules();
|
loadWindowRules();
|
||||||
for( ClientList::Iterator it = clients.begin();
|
for( ClientList::Iterator it = clients.begin();
|
||||||
|
|
Loading…
Reference in a new issue