[wayland] Sync ShellClient's geometry with internal QWindow's geometry

Update geometry when the referenced internal QWindow changes position.
This makes the close button in PresentWindows work.
icc-effect-5.14.5
Martin Gräßlin 2015-05-20 08:27:48 +02:00
parent 75bd798ad9
commit 2ff903e8b3
2 changed files with 12 additions and 1 deletions

View File

@ -49,7 +49,7 @@ ShellClient::ShellClient(ShellSurfaceInterface *surface)
ready_for_painting = false;
}
if (m_internalWindow) {
setGeometry(m_internalWindow->geometry());
updateInternalWindowGeometry();
} else {
setGeometry(QRect(QPoint(0, 0), m_clientSize));
}
@ -361,8 +361,18 @@ void ShellClient::findInternalWindow()
continue;
}
m_internalWindow = w;
connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry);
connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry);
return;
}
}
void ShellClient::updateInternalWindowGeometry()
{
if (!m_internalWindow) {
return;
}
setGeometry(m_internalWindow->geometry());
}
}

View File

@ -100,6 +100,7 @@ private:
void destroyClient();
void createWindowId();
void findInternalWindow();
void updateInternalWindowGeometry();
static void deleteClient(ShellClient *c);
KWayland::Server::ShellSurfaceInterface *m_shellSurface;