Skip to content

Commit

Permalink
add lastWalkedTime to wasm window too
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Jan 26, 2025
1 parent 0325acc commit 22d92fc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/driver/glfw/window_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
_ "image/png" // for the icon
"runtime"
"sync"
"time"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
Expand Down Expand Up @@ -92,6 +93,8 @@ type window struct {
shouldExpand bool

pending []func()

lastWalkedTime time.Time
}

func (w *window) SetFullScreen(full bool) {
Expand Down Expand Up @@ -206,6 +209,14 @@ 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 22d92fc

Please sign in to comment.