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.19k stars 89 forks source link

content window disappears completely when switching to windowed mode #241

Open cpbl opened 2 years ago

cpbl commented 2 years ago

Describe the bug Upon starting pympress, I press "f" to make the fullscreen content window become a window. The content window completely disappears from view!

To Reproduce Start pympress with a PDF (it's a LaTeX beamer pdf). press "f" or ctrl-L, etc.

Expected behavior Full screen content should become a smaller, manageable window

Environment (please complete the following information):

installed by apt: Pympress: 1.6.1 ; Python: 3.9.7 ; OS: Linux 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 ; Gtk 3.24.30 ; GLib 2.68.4 ; Poppler 21.06.1 cairo ; Cairo 1.16.0 , pycairo 1.16.2

Same problem if installed by pip:

Pympress: 1.7.1 ; Python: 3.9.7 ; OS: Linux 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 ; Gtk 3.24.30 ; GLib 2.68.4 ; Poppler 21.06.1 cairo ; Cairo 1.16.0 , pycairo 1.16.2

Debug log:


DEBUG:pympress.util:Failed to get git describe output
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/util.py", line 72, in get_pympress_meta
    git_version = subprocess.check_output(command, stderr = subprocess.DEVNULL)
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir=/home/meuser/.local/lib/python3.9/site-packages/.git', 'describe', '--tags', '--long', '--dirty']' returned non-zero exit status 128.
INFO:pympress.app:Pympress: 1.7.1 ; Python: 3.9.7 ; OS: Linux 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 ; Gtk 3.24.30 ; GLib 2.68.4 ; Poppler 21.06.1 cairo ; Cairo 1.16.0 , pycairo 1.16.2
INFO:pympress.extras:Media support: GdkPixbuf gif player, GStreamer 1.18.5, VLC not available
ERROR:pympress.scribble:Error creating highlight cache
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 155, in __getattr__
    setattr(wrapper, value_name, wrapper(value_info.get_value()))
ValueError: invalid enum value: 5
Cimbali commented 2 years ago

If you’re starting fullscreen you have more than 1 screen, it seems.

Could you share:

It’s likely that the pympres window is on your second monitor or mabe in an area your display configuration creates but that doesn’t render on any monitor.

cpbl commented 2 years ago

You're the best. Thanks for attending to this. Here's the display set up image image The small is my laptop. The large is ... obviously the external. Yes, the content window is coming up full-screen on the external display, while the presenter window comes up not-fullscreen on my laptop.

Config says:


[content]
xalign = 0.5
yalign = 0.5
geometry = 3840x2160+0+0
start_blanked = off
start_fullscreen = on
white_blanking = off

[presenter]
geometry = 1655x757+129+2328
start_fullscreen = off
pointer = red
pointer_mode = manual
show_bigbuttons = on
show_annotations = on
scroll_number = off
slide_ratio = 0.75
next_slide_count = 1

[layout]

By the way, if, after pressing "f", I press Ubuntu-tab to see all my windows, it actually shows both pympress windows, but the content window is blank (black). If I select it, it takes me back to the same desktop where I started, but still nothing is visible and I don't seem to have focus in a window.

thanks!

cpbl commented 2 years ago

Update -- not entirely true! I do get focus back in the invisible window by Ubuntu-tab'ing to it. And by half-screening it with keyboard shortcuts, I could briefly see it, but it's still not being painted at all. I de-maximised it and then found it as a tiny sliver (vertical line) of black. I was able to drag to resize. So I now I actually have that window up on my display. However, it is not rendering at all. From dragging it around, it has some random garbage. Here is what I get if I take a snapshot of that window:

image

and when I move through my presentation, nothing changes; it is not painted.

cpbl commented 2 years ago

Here are some error messages that come up as this is happening (this bug is debilitating for me!)

Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 988, in doc_goto_prev
    self.goto_page(self.preview_page - 1)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 978, in goto_page
    self.do_page_change(autoplay=autoplay)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1134, in do_page_change
    self.scribbler.page_change(self.preview_page, page_preview.label())
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 531, in page_change
    return self.clear_scribble()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 506, in clear_scribble
    self.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1001, in doc_goto_next
    self.goto_page(self.preview_page + 1)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 978, in goto_page
    self.do_page_change(autoplay=autoplay)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1134, in do_page_change
    self.scribbler.page_change(self.preview_page, page_preview.label())
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 531, in page_change
    return self.clear_scribble()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 506, in clear_scribble
    self.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Cimbali commented 2 years ago

These last messages are pretty informative, though I'm surprised Cairo fails only in the caching apparently. Can you try (separately) :

  1. Setting max pages = 0 under [config] in your preferences. This should effectively disable caching (the rendering of cached pages will still be attempted but not saved)
  2. Reducing the resolution on your output to something less than 32768 wide
  3. Removing your config file before starting pympress (you may want to back it up if you did any changes) in the less-than-32768 output, if attempt 2 failed

At every attempt it'd be helpful if you could remove the pympress log, open pympress, and report the newly created log contents.

cpbl commented 2 years ago

Thank you! Can you explain how I would accomplish (2.) in your list?
(Btw, my monitor setup at the moment is shown above, with a max resolution of 3840.)

Also, where is the log file? I am not sure how to run pympress.util.get_log_path() and I can't find the answer in the docs online or in built-in help.

thanks!

cpbl commented 2 years ago

In the mean time:

c

Cimbali commented 2 years ago

So it seems to me (not quite confirmed yet) that this is indeed a regression introduced in ed5c91fa852306aab09710673368c62f0f94551d to fix #159.

Roughly, to improve finnicky rendering we’re now rendering PDF pages to an image surface instead of whatever surface we were using before. However, cairo has a hard limit on image surfaces of 32768 pixels in either direction, so we can’t create the surface to render with a resolution as large as yours. I think this is because these image surfaces are actually arrays of size height × width × pixel size (32b?), so that’s a ~32MB image for each slide on your resolution. Might be a little heavy.

If that’s the case:


For your log file, it’s in $HOME/.cache/pympress.log (or $XDG_CACHE_HOME/pympress.log if that variable exists).

cpbl commented 2 years ago

Thank you! For me, pip3 install --user pympress==1.5.3 has solved this problem by reverting to this older version. However, I don't particularly want to miss out on the more recent fixes and updates. I have this problem on more than one setup (monitor) and my monitor is not large by modern standards. It would be really great if pympress could be launched in windowed mode; it sounds from your description like that would avoid the problem completely. Thanks so much for your amazing project.

Cimbali commented 2 years ago

I must have been pretty asleep when I wrote the message above, Clearly 4k (3840 pixels) is not larger than 32k… unless there is a weird scale factor going on. or something like that (at least 8×? I’d expect not). So still some investigation needed before a fix can be devised.

For that, it would be helpful if you could share the pympress log(s) of when the bug happened. If you didn’t reset it you can even share it as-is to pastebin or something like that so I can have a look for any other hints as to what’s going on.

cpbl commented 2 years ago

Not sure if this is the format you are asking for, but here is an account of stuff that appears in the log during four events in a single run of pympress:


DEBUG:pympress.util:Failed to get git describe output
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/util.py", line 72, in get_pympress_meta
    git_version = subprocess.check_output(command, stderr = subprocess.DEVNULL)
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir=/home/meuser/.local/lib/python3.9/site-packages/.git', 'describe', '--tags', '--long', '--dirty']' returned non-zero exit status 128.
INFO:pympress.app:Pympress: 1.7.1 ; Python: 3.9.7 ; OS: Linux 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 ; Gtk 3.24.30 ; GLib 2.68.4 ; Poppler 21.06.1 cairo ; Cairo 1.16.0 , pycairo 1.16.2
INFO:pympress.extras:Media support: GdkPixbuf gif player, GStreamer 1.18.5, VLC 3.0.16 Vetinari
ERROR:pympress.scribble:Error creating highlight cache
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 155, in __getattr__
    setattr(wrapper, value_name, wrapper(value_info.get_value()))
ValueError: invalid enum value: 5
~

(THEN I PRESSED "f" and the window disappeared and then I focused the invisible window and half-maximized it. Then I grabbed it and moved it around (it becomes inviisible again) until I can see the tiny zero-width speck moving on my desktop.
      When I grab and move, this happens in the log file:

      subprocess.CalledProcessError: Command '['git', '--git-dir=/home/meuser/.local/lib/python3.9/site-packages/.git', 'describe', '--tags', '--long', '--dirty']' returned non-zero exit status 128.
INFO:pympress.app:Pympress: 1.7.1 ; Python: 3.9.7 ; OS: Linux 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 ; Gtk 3.24.30 ; GLib 2.68.4 ; Poppler 21.06.1 cairo ; Cairo 1.16.0 , pycairo 1.16.2
INFO:pympress.extras:Media support: GdkPixbuf gif player, GStreamer 1.18.5, VLC 3.0.16 Vetinari
ERROR:pympress.scribble:Error creating highlight cache
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 155, in __getattr__
    setattr(wrapper, value_name, wrapper(value_info.get_value()))
ValueError: invalid enum value: 5
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

THEN I resize the zero-width speck to make a window (but it doesn't paint) and the resizing generates this in log:

CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 538, in on_configure_da
    self.scribbler.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

THEN I TRY paging through some slides and get this:

CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1001, in doc_goto_next
    self.goto_page(self.preview_page + 1)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 978, in goto_page
    self.do_page_change(autoplay=autoplay)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1134, in do_page_change
    self.scribbler.page_change(self.preview_page, page_preview.label())
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 531, in page_change
    return self.clear_scribble()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 506, in clear_scribble
    self.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 300, in renderer
    surface = self.surface_factory[widget_name](cairo.Format.RGB24, ww, wh)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/surfacecache.py", line 252, in _create_surface
    return window.create_similar_image_surface(fmt, width * scale, height * scale, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

Thank you!!!

Cimbali commented 2 years ago

So same error during the page change, from the highlight module:

CRITICAL:pympress.__main__:Uncaught exception:
Traceback (most recent call last):
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1001, in doc_goto_next
    self.goto_page(self.preview_page + 1)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 978, in goto_page
    self.do_page_change(autoplay=autoplay)
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/ui.py", line 1134, in do_page_change
    self.scribbler.page_change(self.preview_page, page_preview.label())
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 531, in page_change
    return self.clear_scribble()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 506, in clear_scribble
    self.reset_scribble_cache()
  File "/home/meuser/.local/lib/python3.9/site-packages/pympress/scribble.py", line 340, in reset_scribble_cache
    self.scribble_cache = window.create_similar_image_surface(cairo.Format.ARGB32, ww, wh, scale)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

That explains not only pre-rendering but also on-demand rendering fails.

cpbl commented 2 years ago

I think I may have an easy workaround. I was asking how to get pympress to start up not in full screen. There seems to be no command line way to enusre that. But once pympress has started up, there is an option in the dropdown menus Starting configuration -> Content fullscreen. If I turn that off, then from then on in future starts of pympress there's no trouble with the disappearing window.

Cimbali commented 1 year ago

Still not entirely sure what is happening here, but I have (a) improved error reporting and (b) added a fallback painting for the context window, so that even if it fails rendering the desired slide, at least it does not disappear from view.