cursor: refactor CustomCursor to be dyn
cursor: refactor `CustomCursor` to be `dyn` Same as for `MonitorHandle`, the source was changed to support all kinds of sources.
This commit is contained in:
parent
a0464ae83b
commit
ae28eea406
26 changed files with 329 additions and 333 deletions
|
|
@ -36,7 +36,7 @@ use objc2_foundation::{
|
|||
use tracing::{trace, warn};
|
||||
|
||||
use super::app_state::AppState;
|
||||
use super::cursor::cursor_from_icon;
|
||||
use super::cursor::{cursor_from_icon, CustomCursor};
|
||||
use super::monitor::{self, flip_window_screen_coordinates, get_display_id};
|
||||
use super::observer::RunLoop;
|
||||
use super::util::cgerr;
|
||||
|
|
@ -1249,7 +1249,13 @@ impl WindowDelegate {
|
|||
|
||||
let cursor = match cursor {
|
||||
Cursor::Icon(icon) => cursor_from_icon(icon),
|
||||
Cursor::Custom(cursor) => cursor.inner.0,
|
||||
Cursor::Custom(cursor) => match cursor.cast_ref::<CustomCursor>() {
|
||||
Some(cursor) => cursor.0.clone(),
|
||||
None => {
|
||||
tracing::error!("unrecognized cursor passed to macOS backend");
|
||||
return;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if view.cursor_icon() == cursor {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue