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

MacOS Runtime crash when depending on multiple versions of this crate #261

Open
PhilTaken opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@PhilTaken
Copy link

PhilTaken commented Jan 9, 2025

dioxus-desktop currently relies on two different versions of the muda crate which causes a crash when attempting to initialize a tray icon:

DioxusLabs/dioxus#3533

I assume that the reason is this class definition:

declare_class!(
struct MenuItem;
unsafe impl ClassType for MenuItem {
type Super = NSMenuItem;
type Mutability = mutability::MainThreadOnly;
const NAME: &'static str = "MudaMenuItem";
}
impl DeclaredClass for MenuItem {
// FIXME: Use `Rc` or something else to access the MenuChild.
type Ivars = Cell<*const MenuChild>;
}
unsafe impl MenuItem {
#[method(fireMenuItemAction:)]
fn fire_menu_item_action(&self, _sender: Option<&AnyObject>) {
self.fire_menu_item_click();
}
}
);

since the class definition appears to be duplicated when relying on multiple versions of this crate.

Unfortunately, one of the two comes from a transitive dependency via the tray-icon crate so there is no permanent fix on dioxus's side. The next time the two crate's respective muda version requirements diverge it'll break again.

Is there any way to prevent the above duplicate class definition?

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

No branches or pull requests

1 participant