Skip to content

Commit

Permalink
Fix deadlocking on Linux clipboard test (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Dec 17, 2024
1 parent f0bf159 commit ddc5df1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ func (w *window) Canvas() fyne.Canvas {

func (w *window) processClosed() {
if w.onCloseIntercepted != nil {
w.QueueEvent(w.onCloseIntercepted)
w.onCloseIntercepted()
return
}

go w.Close() // unsure which thread this comes from, so don't block
w.Close()
}

// destroy this window and, if it's the last window quit the app
Expand Down
4 changes: 2 additions & 2 deletions internal/driver/glfw/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ func TestWindow_CloseInterception(t *testing.T) {
closed := make(chan bool, 1)
w.SetOnClosed(func() { closed <- true })
w.closed(w.viewport)
w.WaitForEvents()

assert.True(t, onIntercepted, "the interceptor should have been called")
select {
case <-closed:
Expand All @@ -1700,7 +1700,7 @@ func TestWindow_CloseInterception(t *testing.T) {
closed := make(chan bool, 1)
w.SetOnClosed(func() { closed <- true })
w.closed(w.viewport)
w.WaitForEvents()

select {
case <-closed:
case <-time.After(20 * time.Millisecond):
Expand Down

0 comments on commit ddc5df1

Please sign in to comment.