From 261b6d47b1977b6d8cc3e6fbf097325e496ce891 Mon Sep 17 00:00:00 2001 From: SpomJ Date: Wed, 13 May 2026 18:11:53 +0300 Subject: [PATCH] Support translucency in main- and subwindows Subwindow translucency flag is forceful, this probably shouldn't impact anything since it only changes things on compositor level. Alternatively could be done individually for each child window. Unfortunately flag needs to be set before the window is shown (even if it was shown attached), so dynamically tweaking it doesn't seem to work. Overall flag change shouldn't introduce any significant performance drawbacks, if it does converting it to a config option is trivial. --- src/gui/MainWindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 64515160a23..7ee9a89cd99 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -88,6 +88,7 @@ MainWindow::MainWindow() : m_session( SessionState::Normal ) { setAttribute( Qt::WA_DeleteOnClose ); + setAttribute(Qt::WA_TranslucentBackground); auto main_widget = new QWidget(this); auto vbox = new QVBoxLayout(main_widget); @@ -547,6 +548,7 @@ SubWindow* MainWindow::addWindowedWidget(QWidget *w, Qt::WindowFlags windowFlags { // TODO: somehow make this work on any setWidget connect(w, &QWidget::destroyed, win, &SubWindow::deleteLater); + w->setAttribute(Qt::WA_TranslucentBackground); if (w->sizeHint().isValid()) {