Cimbali / pympress

Pympress is a simple yet powerful PDF reader designed for dual-screen presentations
https://cimbali.github.io/pympress/
GNU General Public License v2.0
1.18k stars 89 forks source link

Slide deck overview missing every 2nd slide #311

Closed sven-frotscher closed 6 months ago

sven-frotscher commented 7 months ago

Describe the bug When note slides are involved, the slide deck is missing every second slide.

To Reproduce Steps to reproduce the behavior:

  1. Create a TeX beamer presentation with \setbeameroption{show notes on second screen} (example source code attached below) and open the PDF in Pympress
  2. Presentation - Notes Position and Notes mode seem to make no difference for this bug
  3. Open Presentation - Deck Overview

Both slides and notes are displayed, but every second one is missing. Selecting a slide out of the displayed ones works as expected though.

Expected behavior Every slide is shown (preferably without associated notes).

Screenshots

Environment

Debug information Contents of pympress.log:

INFO:pympress.app:Pympress: 1.8.5 ; Python: 3.11.8 ; OS: Linux 6.7.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 Mar 2024 01:59:01 +0000 ; Gtk 3.24.41 ; GLib 2.78.0 ; Poppler 24.03.0 cairo ; Cairo 1.18.0 , pycairo 1.26.0
INFO:pympress.extras:Media support: GdkPixbuf gif player, GStreamer 1.24.0, VLC not available
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pympress/config.py", line 506, in get_layout
    return self.layout[layout_name]
           ~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'deck'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pympress/ui.py", line 1815, in switch_mode
    self.load_layout(self.layout_name(target_mode))
  File "/usr/lib/python3.11/site-packages/pympress/ui.py", line 1755, in load_layout
    pane_handles = self.replace_layout(self.config.get_layout(new), self.p_central,
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pympress/config.py", line 508, in get_layout
    return self.static_layout[layout_name]
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'deck'

The problem still happens if I remove my config file, although it contains some additional lines in the [notes position] section when compared to the one Pympress auto-generates:

page number = after
page mapping = map
page parity = odd

The bug I'm describing seems unaffected by these entries.

Additional context MWE TeX source code (change the file extension to .tex): num-slides.txt

My guess is that the deck overview only accounts for slides and notes on adjacent pages, not pages split between slide and notes. The CRITICAL log entry only happened when I played around with some settings (e.g. toggling Notes mode while in the deck overview) and I doubt it's related.

Cimbali commented 7 months ago

The errors you’ve got in your logs are quite strange and should have prevented you from loading the deck view altogether. But aside from that can reproduce. It seems like the deck widget is understanding the wrong type of note pages (interleaved instead of second screen?)

sven-frotscher commented 7 months ago

logged errors

The errors started when I toggled Notes mode in the deck view. Pympress got stuck in the deck view after that. That's probably worth a separate issue.

deck widget understanding wrong type of note pages

Agreed.

Cimbali commented 6 months ago

Ok so this is fixed now. It was a combination of a number of rather subtle errors:

sven-frotscher commented 6 months ago

Partially fixed (thank you, for what that's worth): Only the presented slides are shown now (i.e. notes are hidden), but I still don't see slides 2 and 4 from my MWE in the deck overview.

Screenshot:

Pympress screenshot

Cimbali commented 6 months ago

As mentioned above, only showing 2 pages is actually intended. There are 2 ways to fix that, that I’ve listed there too. See also for reference this tex.se post also reporting the page labeling issue.