mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Add methods to get the position of a window's client area, relative to the desktop (#430)
* Add get_inner_position for windows, prototypes for other platforms * Fix linux builds * Implement get_inner_position for osx * Add get_inner_pos implementations for other platforms * Fixed get_inner_position on macOS * Corrected set_position on macOS * Added CHANGELOG entry
This commit is contained in:
committed by
Francesca Frangipane
parent
10688915eb
commit
8fd49a4dbe
@@ -181,6 +181,15 @@ impl Window {
|
||||
self.window.get_position()
|
||||
}
|
||||
|
||||
/// Returns the position of the top-left hand corner of the window's client area relative to the
|
||||
/// top-left hand corner of the desktop.
|
||||
///
|
||||
/// The same conditions that apply to `get_position` apply to this method.
|
||||
#[inline]
|
||||
pub fn get_inner_position(&self) -> Option<(i32, i32)> {
|
||||
self.window.get_inner_position()
|
||||
}
|
||||
|
||||
/// Modifies the position of the window.
|
||||
///
|
||||
/// See `get_position` for more information about the coordinates.
|
||||
|
||||
Reference in New Issue
Block a user