Skip to content

Commit

Permalink
On macOS, fixed undocumented cursors (e.g. zoom, resize, help) always…
Browse files Browse the repository at this point in the history
… appearing to be invalid and falling back to the default cursor.
  • Loading branch information
raphamorim committed Dec 8, 2024
1 parent 8cc2eb3 commit 1e12dc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ language: 'en'

## 0.2.3 (unreleased)

- On macOS, fixed undocumented cursors (e.g. zoom, resize, help) always appearing to be invalid and falling back to the default cursor.
- On X11, Wayland, Windows and macOS, improved scancode conversions for more obscure key codes.
- On macOS, fixed the scancode conversion for audio volume keys.
- On macOS, fixed the scancode conversion for `IntlBackslash`.
Expand Down
4 changes: 2 additions & 2 deletions rio-window/src/platform_impl/macos/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::OnceLock;

use objc2::rc::Retained;
use objc2::runtime::Sel;
use objc2::{msg_send_id, sel, ClassType};
use objc2::{msg_send, msg_send_id, sel, ClassType};
use objc2_app_kit::{NSBitmapImageRep, NSCursor, NSDeviceRGBColorSpace, NSImage};
use objc2_foundation::{
ns_string, NSData, NSDictionary, NSNumber, NSObject, NSObjectProtocol, NSPoint,
Expand Down Expand Up @@ -67,7 +67,7 @@ pub(crate) fn default_cursor() -> Retained<NSCursor> {

unsafe fn try_cursor_from_selector(sel: Sel) -> Option<Retained<NSCursor>> {
let cls = NSCursor::class();
if cls.responds_to(sel) {
if msg_send![cls, respondsToSelector: sel] {
let cursor: Retained<NSCursor> =
unsafe { msg_send_id![cls, performSelector: sel] };
Some(cursor)
Expand Down

0 comments on commit 1e12dc8

Please sign in to comment.