Desktop: Mac menu workaround (#3398)

This commit is contained in:
Timon
2025-11-19 17:13:35 +00:00
committed by GitHub
parent 788e82a7d0
commit 548e0df1a1
13 changed files with 139 additions and 122 deletions
+6
View File
@@ -4,9 +4,11 @@ use winit::window::{Window as WinitWindow, WindowAttributes};
use crate::consts::APP_NAME;
use crate::event::AppEventScheduler;
use crate::window::mac::NativeWindowImpl;
use crate::wrapper::messages::MenuItem;
pub(crate) trait NativeWindow {
fn init() {}
fn configure(attributes: WindowAttributes, event_loop: &dyn ActiveEventLoop) -> WindowAttributes;
fn new(window: &dyn WinitWindow, app_event_scheduler: AppEventScheduler) -> Self;
fn update_menu(&self, _entries: Vec<MenuItem>) {}
@@ -34,6 +36,10 @@ pub(crate) struct Window {
}
impl Window {
pub(crate) fn init() {
NativeWindowImpl::init();
}
pub(crate) fn new(event_loop: &dyn ActiveEventLoop, app_event_scheduler: AppEventScheduler) -> Self {
let mut attributes = WindowAttributes::default()
.with_title(APP_NAME)