@@ -158,6 +158,9 @@ pub enum Error {
158158 /// Failed to get monitor on window operation.
159159 #[ error( "failed to get monitor" ) ]
160160 FailedToGetMonitor ,
161+ /// Failed to get cursor position.
162+ #[ error( "failed to get cursor position" ) ]
163+ FailedToGetCursorPosition ,
161164 #[ error( "Invalid header name: {0}" ) ]
162165 InvalidHeaderName ( #[ from] InvalidHeaderName ) ,
163166 #[ error( "Invalid header value: {0}" ) ]
@@ -293,6 +296,8 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
293296 fn primary_monitor ( & self ) -> Option < Monitor > ;
294297 fn available_monitors ( & self ) -> Vec < Monitor > ;
295298
299+ fn cursor_position ( & self ) -> Result < PhysicalPosition < f64 > > ;
300+
296301 /// Shows the application, but does not automatically focus it.
297302 #[ cfg( target_os = "macos" ) ]
298303 #[ cfg_attr( docsrs, doc( cfg( target_os = "macos" ) ) ) ]
@@ -373,6 +378,8 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
373378 fn primary_monitor ( & self ) -> Option < Monitor > ;
374379 fn available_monitors ( & self ) -> Vec < Monitor > ;
375380
381+ fn cursor_position ( & self ) -> Result < PhysicalPosition < f64 > > ;
382+
376383 /// Sets the activation policy for the application.
377384 #[ cfg( target_os = "macos" ) ]
378385 #[ cfg_attr( docsrs, doc( cfg( target_os = "macos" ) ) ) ]
0 commit comments