diff --git a/src/kwindoweffects.h b/src/kwindoweffects.h --- a/src/kwindoweffects.h +++ b/src/kwindoweffects.h @@ -127,7 +127,7 @@ * * @param window The window for which to enable the blur effect * @param enable Enable the effect if @c true, disable it if @c false - * @param region The region within the window where the background will be blurred + * @param region The region within the window where the background will be blurred, specified in logical pixels */ KWINDOWSYSTEM_EXPORT void enableBlurBehind(WId window, bool enable = true, const QRegion ®ion = QRegion()); @@ -149,7 +149,7 @@ * @param window The window for which to enable the background contrast effect * @param enable Enable the effect if @c true, disable it if @c false * @param brightness How to modify the area brightness: from 0 (make it black) to 2 (make it white), 1 leaves it unchanged - * @param region The region within the window where the background will be modified + * @param region The region within the window where the background will be modified, specified in logical pixels */ KWINDOWSYSTEM_EXPORT void enableBackgroundContrast(WId window, bool enable = true, qreal contrast = 1, qreal intensity = 1, qreal saturation = 1, const QRegion ®ion = QRegion()); diff --git a/src/platforms/xcb/kwindoweffects.cpp b/src/platforms/xcb/kwindoweffects.cpp --- a/src/platforms/xcb/kwindoweffects.cpp +++ b/src/platforms/xcb/kwindoweffects.cpp @@ -19,6 +19,7 @@ #include "kwindoweffects_x11.h" #include +#include #include "kwindowsystem.h" #include @@ -260,7 +261,9 @@ QVector data; data.reserve(rects.count() * 4); Q_FOREACH (const QRect &r, rects) { - data << r.x() << r.y() << r.width() << r.height(); + // kwin on X uses device pixels, convert from logical + auto dpr = qApp->devicePixelRatio(); + data << r.x() * dpr << r.y() * dpr << r.width() * dpr << r.height() * dpr; } xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, atom->atom, XCB_ATOM_CARDINAL, @@ -285,7 +288,8 @@ QVector data; data.reserve(rects.count() * 4 + 16); Q_FOREACH (const QRect &r, rects) { - data << r.x() << r.y() << r.width() << r.height(); + auto dpr = qApp->devicePixelRatio(); + data << r.x() * dpr << r.y() * dpr << r.width() * dpr << r.height() * dpr; } QMatrix4x4 satMatrix; //saturation