window: changing screen now recreates the window on the new screen

This commit is contained in:
outfoxxed 2024-03-09 04:47:40 -08:00
parent 31365dd179
commit 5f9bb9b46c
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 10 additions and 2 deletions

View file

@ -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; }