Skip to content

Commit

Permalink
remove methods for lastWalkedTime
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Jan 28, 2025
1 parent 4ac2dec commit ffb8ab5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
6 changes: 3 additions & 3 deletions internal/driver/glfw/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func (d *gLDriver) drawSingleFrame() {
// n.b. we need to make sure threshold is a bit *after*
// time.Now() - CacheDuration()
threshold := time.Now().Add(time.Second - cache.ValidDuration)
if w.lastWalked().Before(threshold) {
if w.lastWalkedTime.Before(threshold) {
w.canvas.WalkTrees(nil, func(node *common.RenderCacheNode, _ fyne.Position) {
// marks canvas for widget cache entry alive
_ = cache.GetCanvasForObject(node.Obj())
})
w.markWalked()
w.lastWalkedTime = time.Now()
}
continue
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func (d *gLDriver) repaintWindow(w *window) bool {

// mark that we have walked the window and don't
// need to walk it again to mark caches alive
w.markWalked()
w.lastWalkedTime = time.Now()
})
return freed
}
Expand Down
8 changes: 0 additions & 8 deletions internal/driver/glfw/window_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,6 @@ func (w *window) mouseScrolled(viewport *glfw.Window, xoff float64, yoff float64
w.processMouseScrolled(xoff, yoff)
}

func (w *window) lastWalked() time.Time {
return w.lastWalkedTime
}

func (w *window) markWalked() {
w.lastWalkedTime = time.Now()
}

func convertMouseButton(btn glfw.MouseButton, mods glfw.ModifierKey) (desktop.MouseButton, fyne.KeyModifier) {
modifier := desktopModifier(mods)
var button desktop.MouseButton
Expand Down
8 changes: 0 additions & 8 deletions internal/driver/glfw/window_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,6 @@ func (w *window) mouseScrolled(viewport *glfw.Window, xoff, yoff float64) {
w.processMouseScrolled(xoff, yoff)
}

func (w *window) lastWalked() time.Time {
return w.lastWalkedTime
}

func (w *window) markWalked() {
w.lastWalkedTime = time.Now()
}

func convertMouseButton(btn glfw.MouseButton, mods glfw.ModifierKey) (desktop.MouseButton, fyne.KeyModifier) {
modifier := desktopModifier(mods)
var button desktop.MouseButton
Expand Down

0 comments on commit ffb8ab5

Please sign in to comment.