From 5f9bb9b46c1435777f9782f09f077ebc3ef222c9 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 9 Mar 2024 04:47:40 -0800 Subject: [PATCH] window: changing screen now recreates the window on the new screen --- examples | 2 +- src/core/proxywindow.cpp | 7 ++++++- src/core/variants.hpp | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples b/examples index 9c83cc2..f76b43d 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 9c83cc248c968b18a827b4fa4c616a8d362176e1 +Subproject commit f76b43db25fb06a016ccf64ec2b28079c325c346 diff --git a/src/core/proxywindow.cpp b/src/core/proxywindow.cpp index 1c1796a..c0415a7 100644 --- a/src/core/proxywindow.cpp +++ b/src/core/proxywindow.cpp @@ -139,7 +139,12 @@ void ProxyWindowBase::setScreen(QuickshellScreenInfo* screen) { if (this->window == nullptr) { this->mScreen = qscreen; emit this->screenChanged(); - } else this->window->setScreen(qscreen); + } else { + auto reshow = this->window->isVisible(); + if (reshow) this->window->setVisible(false); + this->window->setScreen(qscreen); + if (reshow) this->window->setVisible(true); + } } void ProxyWindowBase::onScreenDestroyed() { this->mScreen = nullptr; } diff --git a/src/core/variants.hpp b/src/core/variants.hpp index 1c5b614..f84a1d7 100644 --- a/src/core/variants.hpp +++ b/src/core/variants.hpp @@ -28,6 +28,9 @@ public: /// See [Quickshell.screens] for an example of using `Variants` to create copies of a window per /// screen. /// +/// > [!WARNING] BUG: Variants currently fails to reload children if the variant set is changed as +/// > it is instantiated. (usually due to a mutation during variant creation) +/// /// [Quickshell.screens]: ../quickshell#prop.screens class Variants: public Reloadable { Q_OBJECT;