Skip to content

Commit

Permalink
Skip render loop if master window is invisible
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDang committed Jan 27, 2022
1 parent 83e20c8 commit 94f03df
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions MasterWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package giu
import (
"image"
"image/color"
"log"
"runtime"
"time"

Expand Down Expand Up @@ -190,11 +191,15 @@ func (w *MasterWindow) sizeChange(width, height int) {
}

func (w *MasterWindow) render() {
if !w.platform.IsMinimized() {
Context.invalidAllState()
defer Context.cleanState()
if !w.platform.IsVisible() {
return
}

Context.invalidAllState()
defer Context.cleanState()

log.Println("window visibility:", w.platform.IsVisible())

rebuildFontAtlas()

p := w.platform
Expand Down

0 comments on commit 94f03df

Please sign in to comment.