Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Apr 29, 2024
1 parent 320b88f commit e7aee8d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
6 changes: 1 addition & 5 deletions core/tauri/scripts/bundle.global.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,14 @@ macro_rules! shared_app_impl {
})
}

/// Get the cursor position relative to the top-left hand corner of the main monitor.
/// Get the cursor position relative to the top-left hand corner of the desktop.
///
/// Note that the top-left hand corner of the desktop is not necessarily the same as the screen.
/// If the user uses a desktop with multiple monitors,
/// the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS
/// or the top-left of the leftmost monitor on X11.
///
/// The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.
pub fn cursor_position(&self) -> crate::Result<PhysicalPosition<f64>> {
Ok(match self.runtime() {
RuntimeOrDispatch::Runtime(h) => h.cursor_position()?,
Expand Down
9 changes: 8 additions & 1 deletion core/tauri/src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,14 @@ impl<R: Runtime> Webview<R> {
self.webview.dispatcher.print().map_err(Into::into)
}

/// Get the cursor position relative to the top-left hand corner of the main monitor.
/// Get the cursor position relative to the top-left hand corner of the desktop.
///
/// Note that the top-left hand corner of the desktop is not necessarily the same as the screen.
/// If the user uses a desktop with multiple monitors,
/// the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS
/// or the top-left of the leftmost monitor on X11.
///
/// The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.
pub fn cursor_position(&self) -> crate::Result<PhysicalPosition<f64>> {
self.app_handle.cursor_position()
}
Expand Down
9 changes: 8 additions & 1 deletion core/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,14 @@ impl<R: Runtime> WebviewWindow<R> {
/// Desktop window getters.
#[cfg(desktop)]
impl<R: Runtime> WebviewWindow<R> {
/// Get the cursor position relative to the top-left hand corner of the main monitor.
/// Get the cursor position relative to the top-left hand corner of the desktop.
///
/// Note that the top-left hand corner of the desktop is not necessarily the same as the screen.
/// If the user uses a desktop with multiple monitors,
/// the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS
/// or the top-left of the leftmost monitor on X11.
///
/// The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.
pub fn cursor_position(&self) -> crate::Result<PhysicalPosition<f64>> {
self.webview.cursor_position()
}
Expand Down
9 changes: 8 additions & 1 deletion core/tauri/src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,14 @@ impl<R: Runtime> Window<R> {
/// Desktop window getters.
#[cfg(desktop)]
impl<R: Runtime> Window<R> {
/// Get the cursor position relative to the top-left hand corner of the main monitor.
/// Get the cursor position relative to the top-left hand corner of the desktop.
///
/// Note that the top-left hand corner of the desktop is not necessarily the same as the screen.
/// If the user uses a desktop with multiple monitors,
/// the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS
/// or the top-left of the leftmost monitor on X11.
///
/// The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.
pub fn cursor_position(&self) -> crate::Result<PhysicalPosition<f64>> {
self.app_handle.cursor_position()
}
Expand Down
6 changes: 4 additions & 2 deletions tooling/api/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2256,11 +2256,13 @@ async function availableMonitors(): Promise<Monitor[]> {
)
}

/** Get the cursor position relative to the top-left hand corner of the desktop.
/**
* Get the cursor position relative to the top-left hand corner of the desktop.
*
* Note that the top-left hand corner of the desktop is not necessarily the same as the screen.
* If the user uses a desktop with multiple monitors,
* the top-left hand corner of the desktop is the top-left hand corner of the monitor at the top-left of the desktop.
* the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS
* or the top-left of the leftmost monitor on X11.
*
* The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.
*/
Expand Down

0 comments on commit e7aee8d

Please sign in to comment.