1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

clipboard: move cl receive to main wlcontext goroutine

This commit is contained in:
bbedward
2025-12-13 00:16:34 -05:00
parent 119e084e52
commit 7641171a01
2 changed files with 39 additions and 17 deletions

View File

@@ -497,7 +497,13 @@ func (m *Manager) receiveData(offer *ext_data_control.ExtDataControlOfferV1, mim
}
defer r.Close()
if err := offer.Receive(mimeType, int(w.Fd())); err != nil {
receiveErr := make(chan error, 1)
m.post(func() {
err := offer.Receive(mimeType, int(w.Fd()))
receiveErr <- err
})
if err := <-receiveErr; err != nil {
w.Close()
return nil, err
}
@@ -516,7 +522,7 @@ func (m *Manager) receiveData(offer *ext_data_control.ExtDataControlOfferV1, mim
select {
case res := <-done:
return res.data, res.err
case <-time.After(100 * time.Millisecond):
case <-time.After(500 * time.Millisecond):
return nil, fmt.Errorf("timeout reading clipboard data")
}
}