rabbit-shocker / rabbit

A programmable presentation tool by Ruby.
http://rabbit-shocker.org/
Other
255 stars 42 forks source link

Crash on OSX Ventura 13.4 #156

Open kingdonb opened 1 year ago

kingdonb commented 1 year ago

Hello, a while ago I opened #142 and since then I've been able to use Rabbit on MacOS with success 🎉

However, once in a while when the window shape changes, I get this crash:

The crash report is too long, so I posted it here in a gist:

https://gist.github.com/kingdonb/a6c414870bc3b4060206e887ee2dc8ac

I think this is just a little bit inconvenient, I miss the "open a hole in the slides" feature which doesn't seem to work on other platforms than X11, but the risk that slides will crash when going to or from full-screen really has only one major impact other than minor disruption to the flow of the talk, the problem is the timer getting reset. So I'm not sure what can be done about this, other than to try and fix the crash.

But other than this one minor bug, Rabbit is now completely usable for me on MacOS 😄 I'm enjoying the new Mermaid diagrams!

kingdonb commented 1 year ago

The crash report in terminal is a bit smaller:

$ make
rabbit lightning.md --size 800,450
Generating single mermaid chart
Generating single mermaid chart
Generating single mermaid chart
Generating single mermaid chart
Assertion failed: (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)), function cairo_surface_destroy, file cairo-surface.c, line 955.
make: *** [lightning] Abort trap: 6

(the error is from make, but you can see it just runs rabbit)

kou commented 1 year ago

Thanks for sharing the backtrace. It seems that it's a rcairo and Ruby's GC related problem.

What were you doing when Rabbit was crashed? (Does "the window shape changes" mean that you changed window size?)

Are you using GTK with X11 backend on macOS, right?

kingdonb commented 1 year ago

No, I'm using Ruby on MacOS and the GTK is compiled with Homebrew. Yes, that's what I mean, the window changed dimensions, not shape. (Shape changes aren't possible without X11 from what I can tell... and they don't seem to work in rootless mode, not for "make a hole in the slides" at least 😢 )

I used to use Rabbit in a VM, on a Linux environment with acceleration. That stopped working at some point due to an upgrade, I think it was a move to Wayland, at least it didn't seem to work, (don't remember because I was never really happy with the solution of running in a VM), but at that time I decided to try on native MacOS again. And much to my surprise and delight, it doesn't have a lot of issues. (I used this on DevOps Toolkit yesterday: https://youtu.be/4tRYJ0mZf5A?t=1786)

It's pretty consistent, crashes for me when I resize the window, and (very) occasionally when I'm entering the fullscreen mode.

kou commented 1 year ago

I'm using Ruby on MacOS and the GTK is compiled with Homebrew.

OK. Rabbit will use GTK4 instead of GTK3 soon. (I hope...) Then the problem may be fixed.

not for "make a hole in the slides" at least

Recently, I don't use the "Rabbit hole" feature because it doesn't work with remote presentation when I share only the Rabbit window. (It work when I share my desktop but I don't want to do it for security concern.)

Instead, I'm using embedded terminal feature. It works with remote presentation.

https://youtu.be/C_-r8IQLAVY?t=551

I used this on DevOps Toolkit yesterday: https://youtu.be/4tRYJ0mZf5A?t=1786

Wow! You're using a custom theme!

kingdonb commented 1 year ago

I included the lightning style, to be able to flip back and forth between lightning style in the same presentation.

This is really the best slide tool to use with markdown, I only wish that it also had all the slow-reveal features of Rabbitdown!

No other Flux maintainers are Rubyists for now 😸

kingdonb commented 1 year ago

https://gitlab.com/ktou/rabbit-slide-kou-rubykaigi-2022

I went digging through your slides looking for how you embedded that terminal there in Rabbit, but I didn't see it!

That is a pretty cool trick 😁 after I made my Rabbit theme to perfectly match the corporate branding guidelines, a few days later Marketing came out and released a whole new set of branding guidelines, all slightly different than before! I resolved to not fix it then, because it took quite a while to figure all that out and I was exhausted, but maybe I should go back and update it to match 😅

Edit: I found the PR that implemented here: https://github.com/rabbit-shocker/rabbit/commit/16f4ad054a11c3e6fad1b2e37b6b05aef70156d3#diff-e61d31dc15318e93239addef0c3ed522f70245322d5500f2a2db37f19d1d798e

and the key binding, but I don't see anything when I press control+alt+shift+t. However while I was in there, I did find the key binding for "reset timer" – I'll remember that one for the future too 😅

kou commented 1 year ago

You need to install vte3 gem explicitly for the embedded terminal feature. :-)

kou commented 1 year ago

I only wish that it also had all the slow-reveal features of Rabbitdown!

Does it mean that a slide transition feature is missing in Rabbit?

kingdonb commented 1 year ago

I don't think it is a missing feature, just feature parity, as I think it only works if you use rabbitdown. Is there a markdown syntax for "show these bullets in slow reveal" like (('wait')) in rd? I only found it in rabbit.rd sample, but it wasn't repeated in the .md file.

kingdonb commented 1 year ago

I did need a hint to install the vte3 gem, thanks for that but it doesn't appear to have done anything.

Does there need to be support from the theme as well, or do you need to be on a "terminal" page? I thought there might be some keyboard mismatch because Apple keyboard usually uses command and not control key, but the "option" key appears to function as normal Alt (and it works with Alt+t to reset the timer) - i'm pressing Ctrl+Alt+Shift+T

I think it's not appropriate for me to ask all these questions on an unrelated issue, but I don't want to spam your repo with minor issues and I appreciate your time. Thank you for your assistance with understanding 🙏

kou commented 1 year ago

You can use {::wait/} in Markdown. :-) See also: https://raw.githubusercontent.com/rabbit-shocker/rabbit/master/sample/rabbit-en.md

Ah, could you apply the following patch to the vte3 gem?

diff --git a/vte3/lib/vte3.rb b/vte3/lib/vte3.rb
index de6c0ff23..44fe90d44 100644
--- a/vte3/lib/vte3.rb
+++ b/vte3/lib/vte3.rb
@@ -27,5 +27,6 @@ module Vte

   Gtk.init if Gtk.respond_to?(:init)
   loader = Loader.new(self)
+  loader.version = "2.91"
   loader.load("Vte")
 end

We need to specify the version explicitly to use GTK3 + VTE instead of GTK4 + VTE. (I'll fix vte3 later.)

I think it's not appropriate for me to ask all these questions on an unrelated issue, but I don't want to spam your repo with minor issues and I appreciate your time. Thank you for your assistance with understanding

How about using https://github.com/rabbit-shocker/rabbit/discussions instead? I hope that we have non-outdated FAQ because we have many undocumented features.

kingdonb commented 1 year ago

My expression right now is 🤯

It's working, I have been able to set up my fonts, this is great 🏆

I will definitely make a fan post of all my favorite undocumented features and put it on Discussions, thanks so much!