Skip to content

Commit 607afc1

Browse files
committed
Rename show_window_menu to show_system_menu
1 parent f93a6d7 commit 607afc1

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

runtime/src/window.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ pub fn change_level<Message>(id: Id, level: Level) -> Command<Message> {
160160
Command::single(command::Action::Window(Action::ChangeLevel(id, level)))
161161
}
162162

163-
/// Show window menu at cursor position.
164-
pub fn show_window_menu<Message>(id: Id) -> Command<Message> {
165-
Command::single(command::Action::Window(Action::ShowWindowMenu(id)))
163+
/// Show the [system menu] at cursor position.
164+
///
165+
/// [system menu]: https://en.wikipedia.org/wiki/Common_menus_in_Microsoft_Windows#System_menu
166+
pub fn show_sytem_menu<Message>(id: Id) -> Command<Message> {
167+
Command::single(command::Action::Window(Action::ShowSystemMenu(id)))
166168
}
167169

168170
/// Fetches an identifier unique to the window, provided by the underlying windowing system. This is

runtime/src/window/action.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ pub enum Action<T> {
8181
GainFocus(Id),
8282
/// Change the window [`Level`].
8383
ChangeLevel(Id, Level),
84-
/// Show window menu at cursor position.
84+
/// Show the system menu at cursor position.
8585
///
8686
/// ## Platform-specific
8787
/// Android / iOS / macOS / Orbital / Web / X11: Unsupported.
88-
ShowWindowMenu(Id),
88+
ShowSystemMenu(Id),
8989
/// Fetch the raw identifier unique to the window.
9090
FetchId(Id, Box<dyn FnOnce(u64) -> T + 'static>),
9191
/// Change the window [`Icon`].
@@ -146,7 +146,7 @@ impl<T> Action<T> {
146146
}
147147
Self::GainFocus(id) => Action::GainFocus(id),
148148
Self::ChangeLevel(id, level) => Action::ChangeLevel(id, level),
149-
Self::ShowWindowMenu(id) => Action::ShowWindowMenu(id),
149+
Self::ShowSystemMenu(id) => Action::ShowSystemMenu(id),
150150
Self::FetchId(id, o) => {
151151
Action::FetchId(id, Box::new(move |s| f(o(s))))
152152
}
@@ -206,8 +206,8 @@ impl<T> fmt::Debug for Action<T> {
206206
Self::ChangeLevel(id, level) => {
207207
write!(f, "Action::ChangeLevel({id:?}, {level:?})")
208208
}
209-
Self::ShowWindowMenu(id) => {
210-
write!(f, "Action::ShowWindowMenu({id:?})")
209+
Self::ShowSystemMenu(id) => {
210+
write!(f, "Action::ShowSystemMenu({id:?})")
211211
}
212212
Self::FetchId(id, _) => write!(f, "Action::FetchId({id:?})"),
213213
Self::ChangeIcon(id, _icon) => {

winit/src/application.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ pub fn run_command<A, C, E>(
807807
window::Action::ChangeLevel(_id, level) => {
808808
window.set_window_level(conversion::window_level(level));
809809
}
810-
window::Action::ShowWindowMenu(_id) => {
810+
window::Action::ShowSystemMenu(_id) => {
811811
if let mouse::Cursor::Available(point) = state.cursor() {
812812
window.show_window_menu(winit::dpi::LogicalPosition {
813813
x: point.x,

winit/src/multi_window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ fn run_command<A, C, E>(
10591059
.set_window_level(conversion::window_level(level));
10601060
}
10611061
}
1062-
window::Action::ShowWindowMenu(id) => {
1062+
window::Action::ShowSystemMenu(id) => {
10631063
if let Some(window) = window_manager.get_mut(id) {
10641064
if let mouse::Cursor::Available(point) =
10651065
window.state.cursor()

0 commit comments

Comments
 (0)