|
@@ -158,6 +158,9 @@ pub enum Error {
|
|
|
/// Failed to get monitor on window operation.
|
|
|
#[error("failed to get monitor")]
|
|
|
FailedToGetMonitor,
|
|
|
+ /// Failed to get cursor position.
|
|
|
+ #[error("failed to get cursor position")]
|
|
|
+ FailedToGetCursorPosition,
|
|
|
#[error("Invalid header name: {0}")]
|
|
|
InvalidHeaderName(#[from] InvalidHeaderName),
|
|
|
#[error("Invalid header value: {0}")]
|
|
@@ -293,6 +296,8 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
|
|
|
fn primary_monitor(&self) -> Option<Monitor>;
|
|
|
fn available_monitors(&self) -> Vec<Monitor>;
|
|
|
|
|
|
+ fn cursor_position(&self) -> Result<PhysicalPosition<f64>>;
|
|
|
+
|
|
|
/// Shows the application, but does not automatically focus it.
|
|
|
#[cfg(target_os = "macos")]
|
|
|
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
|
@@ -373,6 +378,8 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
|
|
|
fn primary_monitor(&self) -> Option<Monitor>;
|
|
|
fn available_monitors(&self) -> Vec<Monitor>;
|
|
|
|
|
|
+ fn cursor_position(&self) -> Result<PhysicalPosition<f64>>;
|
|
|
+
|
|
|
/// Sets the activation policy for the application.
|
|
|
#[cfg(target_os = "macos")]
|
|
|
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|