diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 9a41df8717..139bb988c1 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -614,14 +614,17 @@ QVariant KWin::JSEngineGlobalMethodsWrapper::readConfig(const QString &key, QVar void KWin::JSEngineGlobalMethodsWrapper::registerWindow(QQuickWindow *window) { - QPointer guard = window; - connect( - window, &QWindow::visibilityChanged, this, [guard](QWindow::Visibility visibility) { - if (guard && visibility == QWindow::Hidden) { - guard->destroy(); - } - }, - Qt::QueuedConnection); + if (kwinApp()->operationMode() == Application::OperationModeX11) { + // Windows stop updating if they are remapped. It seems like a bug in QtXCB. + QPointer guard = window; + connect( + window, &QWindow::visibilityChanged, this, [guard](QWindow::Visibility visibility) { + if (guard && visibility == QWindow::Hidden) { + guard->destroy(); + } + }, + Qt::QueuedConnection); + } } bool KWin::JSEngineGlobalMethodsWrapper::registerShortcut(const QString &name, const QString &text, const QKeySequence &keys, QJSValue function)