Allow mocking remote clients

This commit is contained in:
Kovid Goyal
2026-04-19 20:42:43 +05:30
parent 51b0e9c4ad
commit 0ddbffdf79
6 changed files with 47 additions and 18 deletions

View File

@@ -97,10 +97,10 @@ func run_loop(opts *Options, drop_dests map[string]drop_dest, drag_sources map[s
lp.OnInitialize = func() (string, error) {
lp.AllowLineWrapping(false)
if allow_drops {
lp.StartAcceptingDrops(slices.Collect(maps.Keys(drop_dests))...)
lp.StartAcceptingDrops(opts.MachineId, slices.Collect(maps.Keys(drop_dests))...)
}
if allow_drags {
lp.StartOfferingDrags()
lp.StartOfferingDrags(opts.MachineId)
}
lp.SetWindowTitle("Drag and drop")
return "", render_screen()

View File

@@ -34,6 +34,10 @@ choices=copy,move,either
The set of allowed actions when dragging. If :code:`either` is chosen then the drop destination can pick
which action it wants. If the action is a move, then the dragged files are deleted when the drag finishes
and the kitten exits after the drag.
--machine-id
The machine id to use instead of the actual machine id.
'''.format
help_text = '''\