|
22 | 22 | #include "wayland/display.h" |
23 | 23 | #include "wayland/surface.h" |
24 | 24 |
|
| 25 | +#ifdef KWIN_6_2_OR_GREATER |
| 26 | +#include "scene/decorationitem.h" |
| 27 | +#include "scene/surfaceitem.h" |
| 28 | +#include "scene/windowitem.h" |
| 29 | +#endif |
| 30 | + |
25 | 31 | #include <QGuiApplication> |
26 | 32 | #include <QImage> |
27 | 33 | #include <QMatrix4x4> |
@@ -288,6 +294,9 @@ void BlurEffect::updateBlurRegion(EffectWindow *w, bool geometryChanged) |
288 | 294 | BlurEffectData &data = m_windows[w]; |
289 | 295 | data.content = content; |
290 | 296 | data.frame = frame; |
| 297 | +#ifdef KWIN_6_2_OR_GREATER |
| 298 | + data.windowEffect = ItemEffect(w->windowItem()); |
| 299 | +#endif |
291 | 300 | } else if (!geometryChanged) { // Blur may disappear if this method is called when window geometry changes |
292 | 301 | if (auto it = m_windows.find(w); it != m_windows.end()) { |
293 | 302 | effects->makeOpenGLContextCurrent(); |
@@ -437,10 +446,10 @@ bool BlurEffect::enabledByDefault() |
437 | 446 |
|
438 | 447 | bool BlurEffect::supported() |
439 | 448 | { |
440 | | -#ifdef KWIN_6_0 |
441 | | - return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported(); |
442 | | -#else |
| 449 | +#ifdef KWIN_6_1_OR_GREATER |
443 | 450 | return effects->openglContext() && (effects->openglContext()->supportsBlits() || effects->waylandDisplay()); |
| 451 | +#else |
| 452 | + return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported(); |
444 | 453 | #endif |
445 | 454 | } |
446 | 455 |
|
@@ -1097,10 +1106,10 @@ GLTexture *BlurEffect::wallpaper(EffectWindow *desktop, const qreal &scale, cons |
1097 | 1106 | const RenderViewport renderViewport(desktop->frameGeometry(), scale, renderTarget); |
1098 | 1107 | WindowPaintData data; |
1099 | 1108 |
|
1100 | | -#ifdef KWIN_6_0 |
| 1109 | +#ifndef KWIN_6_1_OR_GREATER |
1101 | 1110 | QMatrix4x4 projectionMatrix; |
1102 | | - projectionMatrix.ortho(geometry); |
1103 | | - data.setProjectionMatrix(projectionMatrix); |
| 1111 | + projectionMatrix.ortho(geometry); |
| 1112 | + data.setProjectionMatrix(projectionMatrix); |
1104 | 1113 | #endif |
1105 | 1114 |
|
1106 | 1115 | GLFramebuffer::pushFramebuffer(desktopFramebuffer.get()); |
@@ -1146,7 +1155,7 @@ GLTexture *BlurEffect::createFakeBlurTextureWayland(const Output *output, const |
1146 | 1155 | auto *shader = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace); |
1147 | 1156 | shader->setColorspaceUniforms( |
1148 | 1157 | ColorDescription::sRGB, renderTarget.colorDescription() |
1149 | | -#if !(defined(KWIN_6_1) || defined(KWIN_6_0)) |
| 1158 | +#ifdef KWIN_6_2_OR_GREATER |
1150 | 1159 | , RenderingIntent::RelativeColorimetricWithBPC |
1151 | 1160 | #endif |
1152 | 1161 | ); |
|
0 commit comments