add a wrap for _KDE_SHADOW_OVERRIDE too

svn path=/trunk/KDE/kdelibs/; revision=1070494
This commit is contained in:
Marco Martin 2010-01-05 19:57:44 +00:00
parent 8c356fa8c1
commit 46824ec1b1
2 changed files with 30 additions and 1 deletions

View File

@ -59,6 +59,8 @@ bool isEffectAvailable(Effect effect)
case HighlightWindows:
effectName = "_KDE_WINDOW_HIGHLIGHT";
break;
case OverrideShadow:
effectName = "_KDE_SHADOW_OVERRIDE";
default:
return false;
}
@ -277,6 +279,23 @@ void highlightWindows(WId controller, const QList<WId> &ids)
#endif
}
void shadowOverride(WId window, bool override)
{
#ifdef Q_WS_X11
Display *dpy = QX11Info::display();
Atom atom = XInternAtom( dpy, "_KDE_SHADOW_OVERRIDE", False );
QVarLengthArray<long, 1024> data(1);
data[0] = 1;
if (!override) {
XDeleteProperty(dpy, window, atom);
} else {
XChangeProperty(dpy, window, atom, atom, 32, PropModeReplace,
reinterpret_cast<unsigned char *>(data.data()), data.size());
}
#endif
}
}
}

View File

@ -40,7 +40,8 @@ namespace WindowEffects
WindowPreview = 2,
PresentWindows = 3,
PresentWindowsGroup = 4,
HighlightWindows = 5
HighlightWindows = 5,
OverrideShadow = 6
};
/**
@ -123,6 +124,15 @@ namespace WindowEffects
* @since 4.4
*/
PLASMA_EXPORT void highlightWindows(WId controller, const QList<WId> &ids);
/**
* Forbid te windowmanager to automatically generate a shadow for this window
* @param window the window that won't have shadow
* @param override true if it won't have shadow, false enables it again
*
* @since 4.4
*/
PLASMA_EXPORT void overrideShadow(WId window, bool override);
}
} // namespace Plasma