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

Settings icon_path doesn't seem to do anything on Web or MacOS? #639

Open
Tracked by #552
bwinton opened this issue Jul 25, 2020 · 5 comments
Open
Tracked by #552

Settings icon_path doesn't seem to do anything on Web or MacOS? #639

bwinton opened this issue Jul 25, 2020 · 5 comments
Labels
bug Some API breaks the contract it establishes
Milestone

Comments

@bwinton
Copy link

bwinton commented Jul 25, 2020

Describe the bug
I've tried a few different variants (my latest is here), but no matter what I put there, the MacOS icon in the dock is still the standard "exec" icon, and there is no favicon on the webpage…

To Reproduce
Add an icon_path to your settings, look for that icon, fail to find it. 😉
MacOS

Also when I run cargo web deploy and try to run the resulting code, it gives me the error:

Error loading Rust wasm module 'mazes': RuntimeError: unreachable executed
    initialize http://bwinton.github.io/mazes/mazes.js:1067
    <anonymous> http://bwinton.github.io/mazes/mazes.js:41

Environment and versions (please complete the following information):

  • Environment: macOS Catalina
  • Rust compiler version: Rust nightly 1.46.0
  • Quicksilver verison: "0.4.0-alpha0.5"
@lenscas
Copy link
Contributor

lenscas commented Jul 25, 2020

looks like the path is icon_path: "static/maze.png" try it without the static so it becomes /maze.png.

@bwinton
Copy link
Author

bwinton commented Jul 25, 2020

When I changed it, I get:

$ ls static/maze.png
static/maze.png
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running `target/debug/mazes`
thread 'main' panicked at 'Failed to load image: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })', /Users/bwinton/.cargo/registry/src/github.com-1ecc6299db9ec823/blinds-0.1.6/src/window.rs:116:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@ryanisaacg
Copy link
Owner

Regarding desktop icons, winit (the library quicksilver uses for windowing) does not support window icons on macOS. If upstream support is added, then it will work fine.

Regarding the path to the icon on desktop, I think that's definitely a bug.

I think that the path is wrong on the web, which is your problem there. Try just 'maze.png' and compile for the web.

@ryanisaacg ryanisaacg added the bug Some API breaks the contract it establishes label Jul 26, 2020
@bwinton
Copy link
Author

bwinton commented Jul 26, 2020

I get the same Error loading Rust wasm module 'mazes': RuntimeError: unreachable executed as in the original report.

(Is it trying to load the image from the filesystem in the web version? Is there some sort of "resource bundle" task I need to run first? Or maybe a config file I need to write?)

@lenscas
Copy link
Contributor

lenscas commented Jul 26, 2020

you don't need to bundle it, as cargo web just allows you to reference everything inside the static folder as if that was the root. (So, maze.png instead of static/maze.png).

However, a browser already automatically asks for the icon file at favicon.ico, so just having an .ico file inside the static directory should probably be enough to get it to work for browsers?
`

@ryanisaacg ryanisaacg added this to the v0.4 Alpha milestone Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Some API breaks the contract it establishes
Projects
None yet
Development

No branches or pull requests

3 participants