xwayland: Fix crash when copying from wayland to xwayland (#10786)

This commit is contained in:
Jasson 2025-06-19 13:44:38 -04:00 committed by GitHub
parent 86b5e3bfbc
commit b49d0ca20e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 151 additions and 128 deletions

View file

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