Skip to content

Commit

Permalink
mobileDriver.currentWindow should not return hidden windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fpabl0 authored and andydotxyz committed Feb 21, 2021
1 parent 4eeeb07 commit de2bd50
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/driver/gomobile/driver.go
Expand Up @@ -63,7 +63,15 @@ func (d *mobileDriver) currentWindow() fyne.Window {
return nil
}

return d.windows[len(d.windows)-1]
var last fyne.Window
for i := len(d.windows) - 1; i >= 0; i-- {
last = d.windows[i]
if last.(*window).visible {
return last
}
}

return last
}

func (d *mobileDriver) RenderedTextSize(text string, size float32, style fyne.TextStyle) fyne.Size {
Expand Down

0 comments on commit de2bd50

Please sign in to comment.