Skip to content

Commit f6b592a

Browse files
committed
fix: prevent black screen when loading slides with subsections in Qt presenter
When loading a slide with subsections in --subsections=all mode, start playing first to load the first frame, then immediately pause at position 0. This prevents the black screen that occurs when pausing before the first frame is loaded. Fixes the black background issue when transitioning from slides without subsections to slides with subsections.
1 parent 594df2f commit f6b592a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

manim_slides/present/player.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,11 @@ def load_current_slide(self) -> None:
429429
else:
430430
self.media_player.setLoops(1)
431431

432-
start_paused = use_subsections and self.subsection_mode == SubsectionMode.all
433-
self.load_current_media(start_paused=start_paused)
434-
if use_subsections:
432+
# Always start playing to load the first frame, then pause if needed
433+
self.load_current_media(start_paused=False)
434+
if use_subsections and self.subsection_mode == SubsectionMode.all:
435435
self.media_player.setPosition(0)
436+
self.media_player.pause()
436437

437438
def load_previous_slide(self) -> None:
438439
self.playing_reversed_slide = False

0 commit comments

Comments
 (0)