Paste P293

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Jan 28 2019, 2:15 PM.
diff --git a/shell_client.cpp b/shell_client.cpp
index e336ac5e9..6831cd530 100644
--- a/shell_client.cpp
+++ b/shell_client.cpp
@@ -88,7 +88,9 @@ ShellClient::ShellClient(XdgShellSurfaceInterface *surface)
, m_internal(surface->client() == waylandServer()->internalConnection())
{
setSurface(surface->surface());
- init();
+ // as wl_surface is double buffered, the XdgShellInterface for this surface
+ // is only valid when the surface is committed
+ connect(surface->surface(), &SurfaceInterface::committed, this, &ShellClient::init);
}
ShellClient::ShellClient(XdgShellPopupInterface *surface)
@@ -99,7 +101,7 @@ ShellClient::ShellClient(XdgShellPopupInterface *surface)
, m_internal(surface->client() == waylandServer()->internalConnection())
{
setSurface(surface->surface());
- init();
+ connect(surface->surface(), &SurfaceInterface::committed, this, &ShellClient::init);
}
ShellClient::~ShellClient() = default;
@@ -208,12 +210,13 @@ void ShellClient::initSurface(T *shellSurface)
void ShellClient::init()
{
+ SurfaceInterface *s = surface();
+ disconnect(s, &SurfaceInterface::committed, this, &ShellClient::init);
connect(this, &ShellClient::desktopFileNameChanged, this, &ShellClient::updateIcon);
findInternalWindow();
createWindowId();
setupCompositing();
updateIcon();
- SurfaceInterface *s = surface();
Q_ASSERT(s);
if (s->buffer()) {
setReadyForPainting();
@@ -318,10 +321,10 @@ void ShellClient::init()
}
m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize);
};
- configure();
connect(this, &AbstractClient::activeChanged, this, configure);
connect(this, &AbstractClient::clientStartUserMovedResized, this, configure);
connect(this, &AbstractClient::clientFinishUserMovedResized, this, configure);
+ configure();
} else if (m_xdgShellPopup) {
connect(m_xdgShellPopup, &XdgShellPopupInterface::grabRequested, this, [this](SeatInterface *seat, quint32 serial) {
Q_UNUSED(seat)
davidedmundson edited the content of this paste. (Show Details)Jan 28 2019, 2:15 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.