Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit c442482

Browse files
committed
Merge remote-tracking branch 'origin/main' into window-rules
1 parent 9b1ca22 commit c442482

9 files changed

Lines changed: 35 additions & 17 deletions

File tree

.github/workflows/arch-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore: [ "**.md" ]
77
pull_request:
88
branches: [ main ]
9-
paths: [ "**/arch-linux.yml" ]
9+
paths-ignore: [ "**.md" ]
1010
schedule:
1111
- cron: "0 0 * * *"
1212

.github/workflows/fedora-40.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore: [ "**.md" ]
77
pull_request:
88
branches: [ main ]
9-
paths: [ "**/fedora-40.yml" ]
9+
paths-ignore: [ "**.md" ]
1010
schedule:
1111
- cron: "0 0 * * *"
1212

.github/workflows/nixos-plasma-6-0-5.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore: [ "**.md" ]
77
pull_request:
88
branches: [ main ]
9-
paths: [ "**/nixos-plasma-6-0-5.yml" ]
9+
paths-ignore: [ "**.md" ]
1010
schedule:
1111
- cron: "0 0 * * *"
1212

.github/workflows/nixos-plasma-6-1-5.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore: [ "**.md" ]
77
pull_request:
88
branches: [ main ]
9-
paths: [ "**/nixos-plasma-6-1-5.yml" ]
9+
paths-ignore: [ "**.md" ]
1010
schedule:
1111
- cron: "0 0 * * *"
1212

.github/workflows/nixos-unstable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore: [ "**.md" ]
77
pull_request:
88
branches: [ main ]
9-
paths: [ "**/nixos-unstable.yml" ]
9+
paths-ignore: [ "**.md" ]
1010
schedule:
1111
- cron: "0 0 * * *"
1212

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ find_package(KWin REQUIRED COMPONENTS
6666
kwineffects
6767
)
6868

69-
if(${KWin_VERSION} VERSION_LESS_EQUAL 6.0.5)
70-
add_compile_definitions(KWIN_6_0)
71-
elseif(${KWin_VERSION} VERSION_LESS_EQUAL 6.1.5)
72-
add_compile_definitions(KWIN_6_1)
69+
if(${KWin_VERSION} VERSION_GREATER_EQUAL 6.0.90)
70+
add_compile_definitions(KWIN_6_1_OR_GREATER)
71+
endif()
72+
if(${KWin_VERSION} VERSION_GREATER_EQUAL 6.1.90)
73+
add_compile_definitions(KWIN_6_2_OR_GREATER)
7374
endif()
7475

7576
find_package(KDecoration2 REQUIRED)

src/blur.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ bool BlurEffect::enabledByDefault()
335335

336336
bool BlurEffect::supported()
337337
{
338-
#ifdef KWIN_6_0
339-
return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported();
340-
#else
338+
#ifdef KWIN_6_1_OR_GREATER
341339
return effects->openglContext() && (effects->openglContext()->supportsBlits() || effects->waylandDisplay());
340+
#else
341+
return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported();
342342
#endif
343343
}
344344

@@ -879,10 +879,10 @@ GLTexture *BlurEffect::wallpaper(EffectWindow *desktop, const qreal &scale, cons
879879
const RenderViewport renderViewport(desktop->frameGeometry(), scale, renderTarget);
880880
WindowPaintData data;
881881

882-
#ifdef KWIN_6_0
882+
#ifndef KWIN_6_1_OR_GREATER
883883
QMatrix4x4 projectionMatrix;
884-
projectionMatrix.ortho(geometry);
885-
data.setProjectionMatrix(projectionMatrix);
884+
projectionMatrix.ortho(geometry);
885+
data.setProjectionMatrix(projectionMatrix);
886886
#endif
887887

888888
GLFramebuffer::pushFramebuffer(desktopFramebuffer.get());
@@ -928,7 +928,7 @@ GLTexture *BlurEffect::createStaticBlurTextureWayland(const Output *output, cons
928928
auto *shader = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace);
929929
shader->setColorspaceUniforms(
930930
ColorDescription::sRGB, renderTarget.colorDescription()
931-
#if !(defined(KWIN_6_1) || defined(KWIN_6_0))
931+
#ifdef KWIN_6_2_OR_GREATER
932932
, RenderingIntent::RelativeColorimetricWithBPC
933933
#endif
934934
);

src/blurwindow.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include "utils.h"
21
#include "blurwindow.h"
32

43
#include "effect/effecthandler.h"
@@ -9,6 +8,10 @@
98
#include "wayland/surface.h"
109
#include "window.h"
1110

11+
#ifdef KWIN_6_2_OR_GREATER
12+
#include "scene/windowitem.h"
13+
#endif
14+
1215
#include <KDecoration2/Decoration>
1316

1417
namespace BetterBlur
@@ -104,10 +107,16 @@ void Window::updateBlurRegion(bool geometryChanged)
104107
if (content.has_value() || frame.has_value()) {
105108
m_contentBlurRegion = content;
106109
m_frameBlurRegion = frame;
110+
#ifdef KWIN_6_2_OR_GREATER
111+
m_windowEffect = std::make_unique<KWin::ItemEffect>(w->windowItem());
112+
#endif
107113
} else if (!geometryChanged) { // Blur may disappear if this method is called when window geometry changes
108114
m_contentBlurRegion = {};
109115
m_frameBlurRegion = {};
110116
render.clear();
117+
#ifdef KWIN_6_2_OR_GREATER
118+
m_windowEffect.reset();
119+
#endif
111120
}
112121
}
113122

src/blurwindow.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include "effect/effectwindow.h"
88
#include "opengl/glutils.h"
99

10+
#ifdef KWIN_6_2_OR_GREATER
11+
#include "scene/item.h"
12+
#endif
13+
1014
namespace BetterBlur
1115
{
1216

@@ -72,6 +76,10 @@ public Q_SLOTS:
7276
long net_wm_blur_region = 0;
7377
bool m_blurWhenTransformed = false;
7478

79+
#ifdef KWIN_6_2_OR_GREATER
80+
std::unique_ptr<KWin::ItemEffect> m_windowEffect;
81+
#endif
82+
7583
QSizeF m_size;
7684
bool m_hasWindowBehind = false;
7785
std::unique_ptr<WindowProperties> m_properties;

0 commit comments

Comments
 (0)