mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Handle dnd chunking internally in the loop
This commit is contained in:
@@ -70,6 +70,10 @@ type Loop struct {
|
||||
style_ctx style.Context
|
||||
atomic_update_active bool
|
||||
pointer_shapes []PointerShape
|
||||
dnd_chunking struct {
|
||||
active bool
|
||||
metadata DndCommand
|
||||
}
|
||||
|
||||
// Queried capabilities from terminal
|
||||
TerminalCapabilities TerminalCapabilities
|
||||
|
||||
@@ -271,6 +271,16 @@ func (self *Loop) handle_dnd(data []byte) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
if self.dnd_chunking.active {
|
||||
self.dnd_chunking.metadata.Payload = cmd.Payload
|
||||
self.dnd_chunking.metadata.Has_more = cmd.Has_more
|
||||
self.dnd_chunking.active = cmd.Has_more
|
||||
return self.OnDnDData(self.dnd_chunking.metadata)
|
||||
}
|
||||
if cmd.Has_more {
|
||||
self.dnd_chunking.active = true
|
||||
self.dnd_chunking.metadata = cmd
|
||||
}
|
||||
return self.OnDnDData(cmd)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user