mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 07:47:46 +00:00
Focus and sync window when initialized for a scene
This commit is contained in:
parent
4a6a125739
commit
185f642826
1 changed files with 4 additions and 1 deletions
|
|
@ -8,7 +8,6 @@ from moderngl_window.timers.clock import Timer
|
|||
from functools import wraps
|
||||
import screeninfo
|
||||
|
||||
from manimlib.config import get_global_config
|
||||
from manimlib.constants import ASPECT_RATIO
|
||||
from manimlib.constants import FRAME_SHAPE
|
||||
|
||||
|
|
@ -70,6 +69,8 @@ class Window(PygletWindow):
|
|||
mglw.activate_context(window=self, ctx=self.ctx)
|
||||
self.timer.start()
|
||||
|
||||
self.focus()
|
||||
|
||||
def get_monitor(self, index):
|
||||
try:
|
||||
monitors = screeninfo.get_monitors()
|
||||
|
|
@ -105,6 +106,8 @@ class Window(PygletWindow):
|
|||
"""
|
||||
self._window.set_visible(False)
|
||||
self._window.set_visible(True)
|
||||
# This line seems to resync the viewport
|
||||
self.on_resize(*self.size)
|
||||
|
||||
def to_default_position(self):
|
||||
self.position = self.default_position
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue