Skip to content

Commit

Permalink
Allow windows to be upcasted
Browse files Browse the repository at this point in the history
  • Loading branch information
jgcodes2020 committed Oct 24, 2024
1 parent be6b958 commit 3a3dc58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,11 @@ pub trait Window: Surface {
///
/// [window menu]: https://en.wikipedia.org/wiki/Common_menus_in_Microsoft_Windows#System_menu
fn show_window_menu(&self, position: Position);

/// Upcasts this `Window` to a [`Surface`].
fn as_surface(&self) -> &dyn Surface where Self: Sized {
self
}
}

impl dyn Window {
Expand Down

0 comments on commit 3a3dc58

Please sign in to comment.