diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.cpp b/src/plugins/kdecorations/aurorae/src/aurorae.cpp index 39d228e7e1..f504e098eb 100644 --- a/src/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/src/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -6,6 +6,7 @@ #include "aurorae.h" #include "config-kwin.h" +#include "kwineffects.h" #include "auroraetheme.h" #include "kwinoffscreenquickview.h" @@ -312,7 +313,18 @@ void Decoration::init() m_item->setParentItem(visualParent.value()); visualParent.value()->setProperty("drawBackground", false); } else { - m_view = std::make_unique(this, KWin::OffscreenQuickView::ExportMode::Image); + + // This is an ugly hack to make hidpi rendering work as expected on wayland until we switch + // to Qt 6.3 or newer. See https://codereview.qt-project.org/c/qt/qtdeclarative/+/361506 + if (KWin::effects && KWin::effects->waylandDisplay()) { + m_dummyWindow.reset(new QWindow()); + m_dummyWindow->setOpacity(0); + m_dummyWindow->resize(1, 1); + m_dummyWindow->setFlag(Qt::FramelessWindowHint); + m_dummyWindow->setVisible(true); + } + + m_view = std::make_unique(this, m_dummyWindow.get(), KWin::OffscreenQuickView::ExportMode::Image); m_item->setParentItem(m_view->contentItem()); auto updateSize = [this]() { m_item->setSize(m_view->contentItem()->size()); diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.h b/src/plugins/kdecorations/aurorae/src/aurorae.h index dab97c844e..274647871d 100644 --- a/src/plugins/kdecorations/aurorae/src/aurorae.h +++ b/src/plugins/kdecorations/aurorae/src/aurorae.h @@ -80,6 +80,7 @@ private: KWin::Borders *m_padding; QString m_themeName; + std::unique_ptr m_dummyWindow; std::unique_ptr m_view; };