From 82d819b44af4bb3aa089bfd1bc1be8c7dde99c5b Mon Sep 17 00:00:00 2001 From: Matthias Goerner <1239022+unhyperbolic@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:20:00 -0800 Subject: [PATCH] OpenGL: only redrawing on --- opengl/CyOpenGL.pyx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opengl/CyOpenGL.pyx b/opengl/CyOpenGL.pyx index f4f7da16..ef2fd8e3 100644 --- a/opengl/CyOpenGL.pyx +++ b/opengl/CyOpenGL.pyx @@ -88,9 +88,17 @@ class RawOpenGLWidget(Tk_.Widget, Tk_.Misc): Tk_.Widget.__init__(self, master, 'togl', cnf, kw) self.root = master - self.bind('', self.tkMap_expose_or_configure) + + # We do not have a valid framebuffer yet. + #self.bind('', self.tkMap_expose_or_configure) + #self.bind('', self.tkMap_expose_or_configure) + + # We have a valid framebuffer by the time we get the first + # event. + # Binding to draw will redraw every time the window + # becomes visible. In particular, it will cause the first draw. + self.bind('', self.tkMap_expose_or_configure) - self.bind('', self.tkMap_expose_or_configure) self.initialized = False