Rename DecorationPlugin::noDecoration property to disabled

This commit is contained in:
Martin Gräßlin 2013-04-09 08:11:58 +02:00
parent 265b5523e2
commit 15546e11c2
4 changed files with 24 additions and 24 deletions

View file

@ -443,7 +443,7 @@ void Client::updateDecoration(bool check_workspace_pos, bool force)
destroyDecoration(); destroyDecoration();
if (!noBorder()) { if (!noBorder()) {
setMask(QRegion()); // Reset shape mask setMask(QRegion()); // Reset shape mask
if (decorationPlugin()->hasNoDecoration()) { if (decorationPlugin()->isDisabled()) {
decoration = NULL; decoration = NULL;
} else { } else {
decoration = decorationPlugin()->createDecoration(bridge); decoration = decorationPlugin()->createDecoration(bridge);
@ -674,7 +674,7 @@ void Client::resizeDecoration(const QSize& s)
bool Client::noBorder() const bool Client::noBorder() const
{ {
return decorationPlugin()->hasNoDecoration() || noborder || isFullScreen(); return decorationPlugin()->isDisabled() || noborder || isFullScreen();
} }
bool Client::userCanSetNoBorder() const bool Client::userCanSetNoBorder() const

View file

@ -35,7 +35,7 @@ KWIN_SINGLETON_FACTORY(DecorationPlugin)
DecorationPlugin::DecorationPlugin(QObject *) DecorationPlugin::DecorationPlugin(QObject *)
: KDecorationPlugins(KGlobal::config()) : KDecorationPlugins(KGlobal::config())
, m_noDecoration(false) , m_disabled(false)
{ {
defaultPlugin = "kwin3_oxygen"; defaultPlugin = "kwin3_oxygen";
#ifndef KWIN_BUILD_OXYGEN #ifndef KWIN_BUILD_OXYGEN
@ -44,7 +44,7 @@ DecorationPlugin::DecorationPlugin(QObject *)
#ifdef KWIN_BUILD_DECORATIONS #ifdef KWIN_BUILD_DECORATIONS
loadPlugin(""); // load the plugin specified in cfg file loadPlugin(""); // load the plugin specified in cfg file
#else #else
setNoDecoration(true); setDisabled(true);
#endif #endif
} }
@ -57,7 +57,7 @@ void DecorationPlugin::error(const QString &error_msg)
{ {
qWarning("%s", QString(i18n("KWin: ") + error_msg).toLocal8Bit().data()); qWarning("%s", QString(i18n("KWin: ") + error_msg).toLocal8Bit().data());
setNoDecoration(true); setDisabled(true);
} }
bool DecorationPlugin::provides(Requirement) bool DecorationPlugin::provides(Requirement)
@ -65,19 +65,19 @@ bool DecorationPlugin::provides(Requirement)
return false; return false;
} }
void DecorationPlugin::setNoDecoration(bool noDecoration) void DecorationPlugin::setDisabled(bool disabled)
{ {
m_noDecoration = noDecoration; m_disabled = disabled;
} }
bool DecorationPlugin::hasNoDecoration() const bool DecorationPlugin::isDisabled() const
{ {
return m_noDecoration; return m_disabled;
} }
bool DecorationPlugin::hasShadows() const bool DecorationPlugin::hasShadows() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityProvidesShadow); return factory()->supports(AbilityProvidesShadow);
@ -85,7 +85,7 @@ bool DecorationPlugin::hasShadows() const
bool DecorationPlugin::hasAlpha() const bool DecorationPlugin::hasAlpha() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityUsesAlphaChannel); return factory()->supports(AbilityUsesAlphaChannel);
@ -93,7 +93,7 @@ bool DecorationPlugin::hasAlpha() const
bool DecorationPlugin::supportsAnnounceAlpha() const bool DecorationPlugin::supportsAnnounceAlpha() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityAnnounceAlphaChannel); return factory()->supports(AbilityAnnounceAlphaChannel);
@ -101,7 +101,7 @@ bool DecorationPlugin::supportsAnnounceAlpha() const
bool DecorationPlugin::supportsTabbing() const bool DecorationPlugin::supportsTabbing() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityTabbing); return factory()->supports(AbilityTabbing);
@ -109,7 +109,7 @@ bool DecorationPlugin::supportsTabbing() const
bool DecorationPlugin::supportsFrameOverlap() const bool DecorationPlugin::supportsFrameOverlap() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityExtendIntoClientArea); return factory()->supports(AbilityExtendIntoClientArea);
@ -117,7 +117,7 @@ bool DecorationPlugin::supportsFrameOverlap() const
bool DecorationPlugin::supportsBlurBehind() const bool DecorationPlugin::supportsBlurBehind() const
{ {
if (hasNoDecoration()) { if (m_disabled) {
return false; return false;
} }
return factory()->supports(AbilityUsesBlurBehind); return factory()->supports(AbilityUsesBlurBehind);
@ -125,7 +125,7 @@ bool DecorationPlugin::supportsBlurBehind() const
Qt::Corner DecorationPlugin::closeButtonCorner() Qt::Corner DecorationPlugin::closeButtonCorner()
{ {
if (hasNoDecoration()) { if (m_disabled) {
return Qt::TopRightCorner; return Qt::TopRightCorner;
} }
return factory()->closeButtonCorner(); return factory()->closeButtonCorner();
@ -134,7 +134,7 @@ Qt::Corner DecorationPlugin::closeButtonCorner()
QList< int > DecorationPlugin::supportedColors() const QList< int > DecorationPlugin::supportedColors() const
{ {
QList<int> ret; QList<int> ret;
if (hasNoDecoration()) { if (m_disabled) {
return ret; return ret;
} }
for (Ability ab = ABILITYCOLOR_FIRST; for (Ability ab = ABILITYCOLOR_FIRST;

View file

@ -37,7 +37,7 @@ public:
/** /**
* @returns @c true if there is no decoration plugin. * @returns @c true if there is no decoration plugin.
**/ **/
bool hasNoDecoration() const; bool isDisabled() const;
bool hasShadows() const; bool hasShadows() const;
bool hasAlpha() const; bool hasAlpha() const;
@ -56,8 +56,8 @@ public:
protected: protected:
virtual void error(const QString& error_msg); virtual void error(const QString& error_msg);
private: private:
void setNoDecoration(bool noDecoration); void setDisabled(bool noDecoration);
bool m_noDecoration; bool m_disabled;
KWIN_SINGLETON(DecorationPlugin) KWIN_SINGLETON(DecorationPlugin)
}; };

View file

@ -357,7 +357,7 @@ void Workspace::init()
}; };
DecorationPlugin *deco = DecorationPlugin::self(); DecorationPlugin *deco = DecorationPlugin::self();
if (!deco->hasNoDecoration() && deco->factory()->supports(AbilityExtendIntoClientArea)) if (!deco->isDisabled() && deco->factory()->supports(AbilityExtendIntoClientArea))
protocols[ NETRootInfo::PROTOCOLS2 ] |= NET::WM2FrameOverlap; protocols[ NETRootInfo::PROTOCOLS2 ] |= NET::WM2FrameOverlap;
rootInfo = new RootInfo(this, display(), supportWindow->winId(), "KWin", protocols, 5, screen_number); rootInfo = new RootInfo(this, display(), supportWindow->winId(), "KWin", protocols, 5, screen_number);
@ -917,7 +917,7 @@ void Workspace::slotReconfigure()
updateToolWindows(true); updateToolWindows(true);
DecorationPlugin *deco = DecorationPlugin::self(); DecorationPlugin *deco = DecorationPlugin::self();
if (!deco->hasNoDecoration() && deco->reset(changed)) { if (!deco->isDisabled() && deco->reset(changed)) {
// Decorations need to be recreated // Decorations need to be recreated
// This actually seems to make things worse now // This actually seems to make things worse now
@ -961,7 +961,7 @@ void Workspace::slotReconfigure()
} }
} }
if (!deco->hasNoDecoration()) { if (!deco->isDisabled()) {
rootInfo->setSupported(NET::WM2FrameOverlap, deco->factory()->supports(AbilityExtendIntoClientArea)); rootInfo->setSupported(NET::WM2FrameOverlap, deco->factory()->supports(AbilityExtendIntoClientArea));
} else { } else {
rootInfo->setSupported(NET::WM2FrameOverlap, false); rootInfo->setSupported(NET::WM2FrameOverlap, false);
@ -1815,7 +1815,7 @@ void Workspace::slotCompositingToggled()
{ {
// notify decorations that composition state has changed // notify decorations that composition state has changed
DecorationPlugin *deco = DecorationPlugin::self(); DecorationPlugin *deco = DecorationPlugin::self();
if (!deco->hasNoDecoration()) { if (!deco->isDisabled()) {
deco->factory()->reset(SettingCompositing); deco->factory()->reset(SettingCompositing);
} }
} }