mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
io/input: [API] execute commands immediately
Change the semantics of commands to execute immediately. In cases where execution of a command introduces a inconsistency, freeze event routing and defer the command as well as queued events to the next frame. Rename Source.Queue to Source.Execute to better fit the new command semantics. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-3
@@ -51,17 +51,16 @@ func TestDraggable(t *testing.T) {
|
||||
},
|
||||
)
|
||||
ofr := &offer{data: "hello"}
|
||||
drag.Offer(gtx, "file", ofr)
|
||||
drag.Update(gtx)
|
||||
r.Events(drag, transfer.TargetFilter{Type: drag.Type})
|
||||
drag.Offer(gtx, "file", ofr)
|
||||
r.Frame(gtx.Ops)
|
||||
|
||||
evs := r.Events(drag, transfer.TargetFilter{Type: drag.Type})
|
||||
if len(evs) != 2 {
|
||||
t.Fatalf("expected 2 event, got %d", len(evs))
|
||||
t.Fatalf("expected 3 event, got %d", len(evs))
|
||||
}
|
||||
ev := evs[0].(transfer.DataEvent)
|
||||
ev.Open = nil
|
||||
if got, want := ev.Type, "file"; got != want {
|
||||
t.Errorf("expected %v; got %v", got, want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user