Closed emmanueltouzery closed 3 years ago
This line is probably the error. Can you modify the code in a local clone to see the error?
By the way, we should probably change this as to not hide the error.
yes... I did this:
let e = gtk::init();
eprintln!("###### {:?}", e);
e.unwrap();
And I get:
###### Err(BoolError { message: "Failed to initialize GTK", filename: "/home/emmanuel/.cargo/registry/src/github.com-1ecc6299db9ec823/gtk-0.9.2/src/rt.rs", function: "gtk::rt", line: 129 })
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BoolError { message: "Failed to initialize GTK", filename: "/home/emmanuel/.cargo/registry/src/github.com-1ecc6299db9ec823/gtk-0.9.2/src/rt.rs", function: "gtk::rt", line: 129 }', /home/emmanuel/home/relm/src/lib.rs:334:7
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
So it's a GTK/X11 issue. Probably really something with my system. Weird...
Right, so I ran with GDK_BACKEND=X11
not x11
(case problem).
However I've seen this issue also when run directly on X11, but through flatpak. That was definitely another issue. In that case I suspect it was a failure due to the fact that flatpak has a app-id and prevents the app from running twice at the same time, or something like that.
Seems like a GTK issue indeed. I don't use Wayland so I cannot help you. I suggest you ask on GTK channels as they'll be better able to help you.
Yes, it's really a gtk issue, but possibly we could keep this bug open, but change it as a feature request that relm would return some error details?
gtk-rs returns: https://gtk-rs.org/docs/glib/error/struct.BoolError.html
Which seems to contain a string message. Maybe relm ::run() could return a string instead of () in the error component? I now believe the error I've seen with flatpak was due to the app-id and refusing to run the same app twice, but it was very confusing when I hit that issue.
Sure. I renamed the issue.
Fixed by #275 .
i'm seeing this issue on my system and it may be a problem caused by my setup, not necessarily a bug in relm.
I see sometimes
Widget::run
returningErr(())
when using X11 (but I never saw it when using wayland).For instance, on my sway+wayland setup:
relm/relm-examples $ cargo run --example clock
works just fine.
But
GDK_BACKEND=X11 cargo run --example clock
crashes with:thread 'main' panicked at 'Win::run failed: ()', examples/clock.rs:110:18 note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceThe backtrace is not super useful:
It's the same at least with the headerbar example too.
I also ran
GDK_BACKEND=X11 strace -f cargo run --example clock >& st.txt
and I attach the st.txt file.In which cases can Widget::run return Err(())?
I'm reproducing this on the latest master btw.
st.txt