Fixed bug in setting cursor style
This commit is contained in:
parent
926b59b15d
commit
db2aaa4367
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ pub trait Vector2FExt {
|
||||||
impl Vector2FExt for Vector2F {
|
impl Vector2FExt for Vector2F {
|
||||||
fn to_screen_ns_point(&self, native_window: id) -> NSPoint {
|
fn to_screen_ns_point(&self, native_window: id) -> NSPoint {
|
||||||
unsafe {
|
unsafe {
|
||||||
let point = NSPoint::new(self.x() as f64, -self.y() as f64);
|
let point = NSPoint::new(self.x() as f64, self.y() as f64);
|
||||||
msg_send![native_window, convertPointToScreen: point]
|
msg_send![native_window, convertPointToScreen: point]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,6 +483,7 @@ impl Window {
|
||||||
|
|
||||||
let native_view: id = msg_send![VIEW_CLASS, alloc];
|
let native_view: id = msg_send![VIEW_CLASS, alloc];
|
||||||
let native_view = NSView::init(native_view);
|
let native_view = NSView::init(native_view);
|
||||||
|
|
||||||
assert!(!native_view.is_null());
|
assert!(!native_view.is_null());
|
||||||
|
|
||||||
let window = Self(Rc::new(RefCell::new(WindowState {
|
let window = Self(Rc::new(RefCell::new(WindowState {
|
||||||
|
@ -828,12 +829,11 @@ impl platform::Window for Window {
|
||||||
let self_id = self_borrow.id;
|
let self_id = self_borrow.id;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let window_frame = self_borrow.frame();
|
|
||||||
let app = NSApplication::sharedApplication(nil);
|
let app = NSApplication::sharedApplication(nil);
|
||||||
|
|
||||||
// Convert back to screen coordinates
|
// Convert back to screen coordinates
|
||||||
let screen_point =
|
let screen_point = position.to_screen_ns_point(self_borrow.native_window);
|
||||||
(position + window_frame.origin()).to_screen_ns_point(self_borrow.native_window);
|
|
||||||
let window_number: NSInteger = msg_send![class!(NSWindow), windowNumberAtPoint:screen_point belowWindowWithWindowNumber:0];
|
let window_number: NSInteger = msg_send![class!(NSWindow), windowNumberAtPoint:screen_point belowWindowWithWindowNumber:0];
|
||||||
let top_most_window: id = msg_send![app, windowWithWindowNumber: window_number];
|
let top_most_window: id = msg_send![app, windowWithWindowNumber: window_number];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue