diff --git a/windoweffects.cpp b/windoweffects.cpp index bd7583bd2..952a17ccc 100644 --- a/windoweffects.cpp +++ b/windoweffects.cpp @@ -18,15 +18,18 @@ */ #include "windoweffects.h" - #include #include #ifdef Q_WS_X11 -#include -#include -#include + #include + #include + #include + #include + + #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 ®ion) #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 +} + } } diff --git a/windoweffects.h b/windoweffects.h index 470f54876..80534ee5f 100644 --- a/windoweffects.h +++ b/windoweffects.h @@ -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 ®ion = 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