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

Enable muda macOS menubar on macOS #7312

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

tronical
Copy link
Member

@tronical tronical commented Jan 9, 2025

Hide the winit menu bar and provide a fallback if the app doesn't provide one. Also, activate per window to fix support for multiple windows.

@tronical tronical requested a review from ogoffart January 9, 2025 16:27
@tronical tronical force-pushed the simon/macos-menubar-tweaks branch 2 times, most recently from 75e57ae to 481e206 Compare January 9, 2025 16:28
internal/backends/winit/lib.rs Outdated Show resolved Hide resolved
internal/backends/winit/muda.rs Outdated Show resolved Hide resolved
internal/backends/winit/winitwindowadapter.rs Outdated Show resolved Hide resolved
@tronical tronical force-pushed the simon/macos-menubar-tweaks branch from 481e206 to c5cd488 Compare January 10, 2025 09:27
@ultimaweapon
Copy link

Does muda will be used as a backend for #38? If yes I wonder what is the plan for Linux since AFAIK muda requires a GTK window.

Hide the winit menu bar and provide a fallback if the app doesn't
provide one. Also, activate per window to fix support for multiple
windows.
@tronical tronical force-pushed the simon/macos-menubar-tweaks branch from c5cd488 to 7c1ef97 Compare January 10, 2025 09:45
@tronical
Copy link
Member Author

Does muda will be used as a backend for #38? If yes I wonder what is the plan for Linux since AFAIK muda requires a GTK window.

The plan for Linux is not to use Muda (exactly because, among other things, Gtk and winit can't be combined) and instead the menu bar and context menus are implemented in Slint natively.

@tronical tronical merged commit 5acd931 into master Jan 10, 2025
35 checks passed
@tronical tronical deleted the simon/macos-menubar-tweaks branch January 10, 2025 09:49
#[allow(unused_mut)]
let mut default_builder = winit::event_loop::EventLoop::with_user_event();
#[cfg(all(feature = "muda", target_os = "macos"))]
winit::platform::macos::EventLoopBuilderExtMacOS::with_default_menu(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if the user set an event_loop_builder (using the private API) the menu won't be visible. I believe we probably should disable the default_menu even if there is already an event_loop_builder. No?

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

Successfully merging this pull request may close these issues.

3 participants