forked from quickshell/quickshell
core/window: add closed() signal to all window types
This commit is contained in:
parent
5706c09e6f
commit
a2146f6394
4 changed files with 17 additions and 1 deletions
|
@ -188,7 +188,7 @@ void ProxyWindowBase::connectWindow() {
|
|||
this->window->setProxy(this);
|
||||
|
||||
// clang-format off
|
||||
QObject::connect(this->window, &QWindow::visibilityChanged, this, &ProxyWindowBase::visibleChanged);
|
||||
QObject::connect(this->window, &QWindow::visibilityChanged, this, &ProxyWindowBase::onVisibleChanged);
|
||||
QObject::connect(this->window, &QWindow::xChanged, this, &ProxyWindowBase::xChanged);
|
||||
QObject::connect(this->window, &QWindow::yChanged, this, &ProxyWindowBase::yChanged);
|
||||
QObject::connect(this->window, &QWindow::widthChanged, this, &ProxyWindowBase::widthChanged);
|
||||
|
@ -226,6 +226,16 @@ void ProxyWindowBase::completeWindow() {
|
|||
emit this->screenChanged();
|
||||
}
|
||||
|
||||
void ProxyWindowBase::onVisibleChanged() {
|
||||
if (this->mVisible && !this->window->isVisible()) {
|
||||
this->mVisible = false;
|
||||
this->setVisibleDirect(false);
|
||||
emit this->closed();
|
||||
}
|
||||
|
||||
emit this->visibleChanged();
|
||||
}
|
||||
|
||||
bool ProxyWindowBase::deleteOnInvisible() const { return false; }
|
||||
|
||||
QQuickWindow* ProxyWindowBase::backingWindow() const { return this->window; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue