[client] transport: report loss before provider cleanup
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae
2026-08-16 21:26:20 +10:00
parent eaafc52f10
commit da36a5c4c2
2 changed files with 9 additions and 6 deletions

View File

@@ -1212,10 +1212,10 @@ int main_cursorThread(void * unused)
if (status == LG_TRANSPORT_DISCONNECTED)
{
primaryLost();
lgInput_dropTransport();
lgAudio_dropTransport();
clipboard_dropTransport();
primaryLost();
}
else
{
@@ -1416,10 +1416,10 @@ int main_frameThread(void * unused)
}
if (status == LG_TRANSPORT_DISCONNECTED)
{
primaryLost();
lgInput_dropTransport();
lgAudio_dropTransport();
clipboard_dropTransport();
primaryLost();
}
else if (status == LG_TRANSPORT_END)
primaryWorkerFailed();
@@ -3921,10 +3921,10 @@ restart:
if (unlikely(!g_state.transport.ops->sessionValid(
g_state.transport.handle)))
{
primaryLost();
lgInput_dropTransport();
lgAudio_dropTransport();
clipboard_dropTransport();
primaryLost();
break;
}
lgMessage_process();

View File

@@ -262,6 +262,12 @@ static bool cleanupConnection(LG_TransportFallback * fallback,
fallback->connectedReported = false;
LG_UNLOCK_EXCLUSIVE(fallback->lock);
/* Report a dead session before provider teardown, which may be waiting on
* work abandoned by the remote endpoint. */
const bool reportLost = knownDead && reportDisconnected &&
!atomic_load_explicit(&fallback->stop, memory_order_acquire);
notifyLost(fallback, reportLost);
const bool live = !knownDead && sessionLive(fallback);
unpublishProviders(fallback, live);
@@ -476,9 +482,6 @@ static bool connectFallback(LG_TransportFallback * fallback)
if (reportMismatch && fallback->eventOps.endpointMismatch)
fallback->eventOps.endpointMismatch(
fallback->eventOpaque, primaryUUID, fallbackUUID);
const bool reportLost = lost && reportDisconnect && !atomic_load_explicit(
&fallback->stop, memory_order_acquire);
notifyLost(fallback, reportLost);
notifyDisconnected(fallback, reportDisconnect);
return true;
}