Commit a6b2bd53 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Fix crash when setting blur effect

Basically to use QWidget::windowHandle() to get a QWindow*, we need to first
set the Qt::WA_NativeWindow attribute on the QWidget. See:

BUG: 439871
FIXED-IN: 21.12
parent 512ce440
......@@ -56,6 +56,8 @@
#include "terminalDisplay/TerminalDisplay.h"
#include "widgets/ViewContainer.h"
#include <konsoledebug.h>
using namespace Konsole;
MainWindow::MainWindow() :
......@@ -889,7 +891,15 @@ void MainWindow::setBlur(bool blur)
KWindowEffects::enableBlurBehind(winId(), blur);
KWindowEffects::enableBlurBehind(windowHandle(), blur);
// Set the WA_NativeWindow attribute to force the creation of the QWindow.
// Without this QWidget::windowHandle() returns 0.
// See
if (QWindow *window = windowHandle()) {
KWindowEffects::enableBlurBehind(window, blur);
} else {
qCWarning(KonsoleDebug) << "Blur effect couldn't be enabled.";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment