Skip to content

Commit

Permalink
Another race that CI reported
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Jan 13, 2025
1 parent c9c42a7 commit b6f7a23
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/driver/glfw/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,17 @@ func TestWindow_TappedSecondary(t *testing.T) {
o.SetMinSize(fyne.NewSize(100, 100))
w.SetContent(o)

w.mousePos = fyne.NewPos(50, 60)
w.mouseClicked(w.viewport, glfw.MouseButton2, glfw.Press, 0)
w.mouseClicked(w.viewport, glfw.MouseButton2, glfw.Release, 0)
runOnMain(func() {
w.mousePos = fyne.NewPos(50, 60)
w.mouseClicked(w.viewport, glfw.MouseButton2, glfw.Press, 0)
w.mouseClicked(w.viewport, glfw.MouseButton2, glfw.Release, 0)

assert.Nil(t, o.popTapEvent(), "no primary tap")
if e, _ := o.popSecondaryTapEvent().(*fyne.PointEvent); assert.NotNil(t, e, "tapped secondary") {
assert.Equal(t, fyne.NewPos(50, 60), e.AbsolutePosition)
assert.Equal(t, fyne.NewPos(46, 56), e.Position)
}
assert.Nil(t, o.popTapEvent(), "no primary tap")
if e, _ := o.popSecondaryTapEvent().(*fyne.PointEvent); assert.NotNil(t, e, "tapped secondary") {
assert.Equal(t, fyne.NewPos(50, 60), e.AbsolutePosition)
assert.Equal(t, fyne.NewPos(46, 56), e.Position)
}
})
}

func TestWindow_TappedSecondary_OnPrimaryOnlyTarget(t *testing.T) {
Expand Down

0 comments on commit b6f7a23

Please sign in to comment.