diff options
Diffstat (limited to 'src/protocols/PrimarySelection.cpp')
| -rw-r--r-- | src/protocols/PrimarySelection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/protocols/PrimarySelection.cpp b/src/protocols/PrimarySelection.cpp index 14df7af5..2b01eddd 100644 --- a/src/protocols/PrimarySelection.cpp +++ b/src/protocols/PrimarySelection.cpp @@ -298,6 +298,7 @@ void CPrimarySelectionProtocol::setSelection(SP<IDataSource> source) { if (!DESTDEVICE) { LOGM(LOG, "CWLDataDeviceProtocol::setSelection: cannot send selection to a client without a data_device"); + g_pSeatManager->m_selection.currentPrimarySelection.reset(); return; } @@ -308,9 +309,10 @@ void CPrimarySelectionProtocol::updateSelection() { if (!g_pSeatManager->m_state.pointerFocusResource) return; + auto selection = g_pSeatManager->m_selection.currentPrimarySelection.lock(); auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.pointerFocusResource->client()); - if (!DESTDEVICE) { + if (!selection || !DESTDEVICE) { LOGM(LOG, "CPrimarySelectionProtocol::updateSelection: cannot send selection to a client without a data_device"); return; } |
