Skip to content

Commit

Permalink
Fix issue where SetFullScreen() would not work before Run()
Browse files Browse the repository at this point in the history
Fixes #119
  • Loading branch information
andydotxyz committed Feb 14, 2019
1 parent a7440a7 commit 0fe75ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion driver/gl/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type window struct {
fullScreen bool
fixedSize bool
padded bool
visible bool

mousePos fyne.Position
onClosed func()
Expand All @@ -57,8 +58,11 @@ func (w *window) FullScreen() bool {
}

func (w *window) SetFullScreen(full bool) {
w.fullScreen = full
if !w.visible {
return
}
runOnMainAsync(func() {
w.fullScreen = full
monitor := w.getMonitorForWindow()
mode := monitor.GetVideoMode()

Expand Down Expand Up @@ -234,13 +238,19 @@ func (w *window) detectScale() float32 {

func (w *window) Show() {
runOnMainAsync(func() {
w.visible = true
w.viewport.Show()

if w.fullScreen {
w.SetFullScreen(true)
}
})
}

func (w *window) Hide() {
runOnMainAsync(func() {
w.viewport.Hide()
w.visible = false
})
}

Expand Down

0 comments on commit 0fe75ad

Please sign in to comment.