Skip to content

Commit 9553ea2

Browse files
committed
go back to only walking visible trees in EnsureMinSize
1 parent ffcb614 commit 9553ea2

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

cmd/fyne_demo/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ func makeNav(setTutorial func(tutorial tutorials.Tutorial), loadPrevious bool) f
253253

254254
themes := container.NewGridWithColumns(2,
255255
widget.NewButton("Dark", func() {
256-
//a.Settings().SetTheme(&forcedVariant{Theme: theme.DefaultTheme(), variant: theme.VariantDark})
256+
a.Settings().SetTheme(&forcedVariant{Theme: theme.DefaultTheme(), variant: theme.VariantDark})
257257
}),
258258
widget.NewButton("Light", func() {
259-
//a.Settings().SetTheme(&forcedVariant{Theme: theme.DefaultTheme(), variant: theme.VariantLight})
259+
a.Settings().SetTheme(&forcedVariant{Theme: theme.DefaultTheme(), variant: theme.VariantLight})
260260
}),
261261
)
262262

internal/driver/common/canvas.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (c *Canvas) EnsureMinSize() bool {
124124
}
125125
}
126126
}
127-
c.WalkCompleteTrees(nil, ensureMinSize)
127+
c.WalkTrees(nil, ensureMinSize)
128128

129129
shouldResize := windowNeedsMinSizeUpdate && (csize.Width < min.Width || csize.Height < min.Height)
130130
if shouldResize {

internal/driver/glfw/canvas.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func (c *glCanvas) markAlive(visibleOnly bool) {
258258
case *canvas.Text:
259259
_, _ = cache.GetTextTexture(glcommon.FontCacheEntryForText(obj, c))
260260
case fyne.Widget:
261-
_ = cache.Renderer(obj)
261+
_, _ = cache.CachedRenderer(obj)
262262
}
263263
}
264264

internal/driver/glfw/loop.go

+5
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ func (d *gLDriver) drawSingleFrame() {
7878
d.cleanInactiveWindowTextures(w, !shouldCleanCanvases /*walkVisibleOnly*/)
7979
}
8080
continue
81+
} else if shouldCleanCanvases {
82+
// EnsureMinSize and paint only walk visible trees.
83+
// Walk entire trees of window and mark alive,
84+
// so that we do not clean CanvasForObject entries of hidden objects.
85+
w.canvas.markAlive(false /*visibleOnly*/)
8186
}
8287

8388
refreshed = refreshed || d.repaintWindow(w, shouldClean)

0 commit comments

Comments
 (0)