Set normalized view id for broadcast (ie. slide preview) thumbnails.

Change-Id: Ica5312ae9c7147c8dc969523e28d460348ba2e76
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
Michael Meeks 2020-11-13 16:21:08 +00:00 committed by Mert Tümer
parent 04139d31cd
commit 0d10c2cae8
3 changed files with 9 additions and 5 deletions

View file

@ -894,9 +894,7 @@ bool ClientSession::sendTile(const char * /*buffer*/, int /*length*/, const Stri
{
try
{
TileDesc tileDesc = TileDesc::parse(tokens);
tileDesc.setNormalizedViewId(getCanonicalViewId());
docBroker->handleTileRequest(tileDesc, client_from_this());
docBroker->handleTileRequest(tokens, client_from_this());
}
catch (const std::exception& exc)
{

View file

@ -1755,12 +1755,15 @@ size_t DocumentBroker::getMemorySize() const
}
// Expected to be legacy, ~all new requests are tilecombinedRequests
void DocumentBroker::handleTileRequest(TileDesc& tile,
void DocumentBroker::handleTileRequest(const StringVector &tokens,
const std::shared_ptr<ClientSession>& session)
{
assertCorrectThread();
std::unique_lock<std::mutex> lock(_mutex);
TileDesc tile = TileDesc::parse(tokens);
tile.setNormalizedViewId(session->getCanonicalViewId());
tile.setVersion(++_tileVersion);
const std::string tileMsg = tile.serialize();
LOG_TRC("Tile request for " << tileMsg);
@ -1785,7 +1788,10 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
for (auto& it: _sessions)
{
if (!it.second->inWaitDisconnected())
{
tile.setNormalizedViewId(it.second->getCanonicalViewId());
tileCache().subscribeToTileRendering(tile, it.second, now);
}
}
}
else

View file

@ -243,7 +243,7 @@ public:
_tileCache->invalidateTiles(tiles, normalizedViewId);
}
void handleTileRequest(TileDesc& tile,
void handleTileRequest(const StringVector &tokens,
const std::shared_ptr<ClientSession>& session);
void handleTileCombinedRequest(TileCombined& tileCombined,
const std::shared_ptr<ClientSession>& session);