[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.
remotes/origin/Plasma/5.4
Martin Gräßlin 11 years ago
parent 75bd798ad9
commit 2ff903e8b3
  1. 12
      shell_client.cpp
  2. 1
      shell_client.h

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

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

Loading…
Cancel
Save