Revert system menus support

The current implementation has some important issues on Windows. We will reintroduce the feature once we figure them out!

I have kept some of the changes in #945, like the new `keyboard::Modifiers` powered by `bitflags`.
This commit is contained in:
Héctor Ramón Jiménez 2021-09-15 15:31:40 +07:00
parent 93fec8d273
commit c0ab988842
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
21 changed files with 19 additions and 673 deletions

View file

@ -15,7 +15,6 @@ use iced_futures::futures;
use iced_futures::futures::channel::mpsc;
use iced_graphics::window;
use iced_native::program::Program;
use iced_native::Menu;
use iced_native::{Cache, UserInterface};
use std::mem::ManuallyDrop;
@ -100,13 +99,6 @@ pub trait Application: Program {
fn should_exit(&self) -> bool {
false
}
/// Returns the current system [`Menu`] of the [`Application`].
///
/// By default, it returns an empty [`Menu`].
fn menu(&self) -> Menu<Self::Message> {
Menu::new()
}
}
/// Runs an [`Application`] with an executor, compositor, and the provided
@ -153,7 +145,6 @@ where
event_loop.primary_monitor(),
settings.id,
)
.with_menu(Some(conversion::menu(&application.menu())))
.build(&event_loop)
.map_err(Error::WindowCreationFailed)?;
@ -419,16 +410,6 @@ async fn run_instance<A, E, C>(
},
}
}
event::Event::WindowEvent {
event: event::WindowEvent::MenuEntryActivated(entry_id),
..
} => {
if let Some(message) =
conversion::menu_message(state.menu(), entry_id)
{
messages.push(message);
}
}
event::Event::WindowEvent {
event: window_event,
..