mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
io/input: merge event queues
Replace the per-event event queues with a single queue of events, each marked with the target tag. This change is a prerequisite for lazy event delivery. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -38,11 +38,12 @@ func (q *clipboardQueue) ReadClipboard() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (q *clipboardQueue) Push(e event.Event, events *handlerEvents) {
|
||||
func (q *clipboardQueue) Push(evts []taggedEvent, e event.Event) []taggedEvent {
|
||||
for r := range q.receivers {
|
||||
events.Add(r, e)
|
||||
evts = append(evts, taggedEvent{tag: r, event: e})
|
||||
delete(q.receivers, r)
|
||||
}
|
||||
return evts
|
||||
}
|
||||
|
||||
func (q *clipboardQueue) ProcessWriteClipboard(req clipboard.WriteCmd) {
|
||||
|
||||
Reference in New Issue
Block a user