Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content window disappears completely when switching to windowed mode #241

Open
cpbl opened this issue Feb 11, 2022 · 14 comments
Open

content window disappears completely when switching to windowed mode #241

cpbl opened this issue Feb 11, 2022 · 14 comments
Labels

Comments

@cpbl
Copy link

cpbl commented Feb 11, 2022

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
Copy link
Owner

Cimbali commented Feb 12, 2022

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

Could you share:

  • your display configuration? E.g. how many screens are connected to your setup, where they are relative to each other, etc. Maybe a screenshot of your display configuration settings panel (something like this) could be easier
  • the values of geometry under the content and presenter sections in your config file (at ~/.config/pympress)

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
Copy link
Author

cpbl commented Feb 12, 2022

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
Copy link
Author

cpbl commented Feb 12, 2022

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
Copy link
Author

cpbl commented Feb 21, 2022

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
Copy link
Owner

Cimbali commented Feb 22, 2022

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
Copy link
Author

cpbl commented Feb 22, 2022

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
Copy link
Author

cpbl commented Feb 22, 2022

In the mean time:

  • unplugging my external monitor, with maxpages=200 or maxpages=0, solves the problem. After launching pympress, I can plug in the monitor again and it continues to work fine.

  • I think this is a regression. I've been using pympress with this set up for quite a while (or at least with an equally-sized external monitor).

  • It seems if I could just force it to start out in windowed mode rather than having to press "f" once it's started, maybe it would work?

c

@Cimbali
Copy link
Owner

Cimbali commented Feb 22, 2022

So it seems to me (not quite confirmed yet) that this is indeed a regression introduced in ed5c91f 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:

  • the maxpages fix should do nothing apart from reducing pympress’ memory footprint − you should still have the bug
  • reducing the resolution should work.
    You can do that from the display set up you screenshot, selecting your display 2, and picking another 16:9 resolution value instead of 3840 x 2160 in the resolution dropdown, e.g. try 2560×1440
  • Another workaround would be to revert to a version before Fails to properly render PDF  #159 was fixed, so likely v1.5.3

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

@Cimbali Cimbali added the bug label Feb 22, 2022
@cpbl
Copy link
Author

cpbl commented Feb 23, 2022

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
Copy link
Owner

Cimbali commented Feb 24, 2022

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
Copy link
Author

cpbl commented Feb 24, 2022

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
Copy link
Owner

Cimbali commented Feb 24, 2022

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
Copy link
Author

cpbl commented Mar 17, 2022

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 added a commit that referenced this issue Mar 9, 2023
Stop showing the perpetual and harmless cairo introspection error

Should give us more info for errors like #241, and default to drawing a
black background on the content drawing area
@Cimbali
Copy link
Owner

Cimbali commented Mar 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants