initial commit of the KWin dashboard effect

svn path=/trunk/KDE/kdelibs/; revision=1153704
This commit is contained in:
Andreas Demmer 2010-07-23 19:52:20 +00:00
parent 2687d8595b
commit 90c8d09d11
2 changed files with 34 additions and 6 deletions

View File

@ -18,15 +18,18 @@
*/
#include "windoweffects.h"
#include <QVarLengthArray>
#include <kwindowsystem.h>
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <QX11Info>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <QX11Info>
#define DASHBOARD_WIN_NAME "dashboard"
#define DASHBOARD_WIN_CLASS "dashboard"
#endif
namespace Plasma
@ -66,6 +69,10 @@ bool isEffectAvailable(Effect effect)
case BlurBehind:
effectName = "_KDE_NET_WM_BLUR_BEHIND_REGION";
break;
case Dashboard:
// TODO: Better namespacing for atoms
effectName = "_WM_EFFECT_KDE_DASHBOARD";
break;
default:
return false;
}
@ -322,6 +329,16 @@ void enableBlurBehind(WId window, bool enable, const QRegion &region)
#endif
}
void markAsDashboard(WId window)
{
#ifdef Q_WS_X11
XClassHint classHint;
classHint.res_name = DASHBOARD_WIN_NAME;
classHint.res_class = DASHBOARD_WIN_CLASS;
XSetClassHint(QX11Info::display(), window, &classHint);
#endif
}
}
}

View File

@ -42,7 +42,8 @@ namespace WindowEffects
PresentWindowsGroup = 4,
HighlightWindows = 5,
OverrideShadow = 6,
BlurBehind = 7
BlurBehind = 7,
Dashboard = 8
};
/**
@ -145,11 +146,21 @@ namespace WindowEffects
* excluding any shadow or halo.
*
* @param window The window for which to enable the blur effect
* @param enable Enable the effect if @a true, disable it if @false
* @param enable Enable the effect if @a true, disable it if @false
* @param region The region within the window where the background will be blurred
* @since 4.5
*/
PLASMA_EXPORT void enableBlurBehind(WId window, bool enable = true, const QRegion &region = QRegion());
/**
* Instructs the window manager to handle the given window as dashboard window as
* Dashboard windows should be handled diffrently and may have special effects
* applied to them.
*
* @param window The window for which to enable the blur effect
* @since 4.6
*/
PLASMA_EXPORT void markAsDashboard(WId window);
}
} // namespace Plasma