Skip to content

Commit

Permalink
PostEmptyEvent from Canvas.SetDirty() as part of threading transition…
Browse files Browse the repository at this point in the history
… plan
  • Loading branch information
dweymouth committed Jan 17, 2025
1 parent 3a6b0ba commit 4a917f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/driver/common/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,13 @@ func (c *Canvas) CheckDirtyAndClear() bool {
// SetDirty sets canvas dirty flag atomically.
func (c *Canvas) SetDirty() {
c.dirty.Store(true)

// wake up main thread in case we were called from goroutine
// TODO: hide this behind the migration flag introduced in
// https://github.com/fyne-io/fyne/pull/5425
if drv, ok := fyne.CurrentApp().Driver().(interface{ PostEmptyEvent() }); ok {
drv.PostEmptyEvent()
}
}

// SetMenuTreeAndFocusMgr sets menu tree and focus manager.
Expand Down

0 comments on commit 4a917f0

Please sign in to comment.