Skip to content

Commit

Permalink
Use frame instead of visibleRect (#3043)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored and kchibisov committed Oct 21, 2023
1 parent 647c320 commit a8a0462
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ And please only add new entries to the top of this list, right below the `# Unre
# Unreleased

- Implement `PartialOrd` and `Ord` for `Key`, `KeyCode`, `NativeKey`, and `NativeKeyCode`.
- Fix window size sometimes being invalid when resizing on macOS.

# 0.29.1-beta

Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ disallowed-methods = [
{ path = "web_sys::Element::request_fullscreen", reason = "Doesn't account for compatibility with Safari" },
{ path = "web_sys::Document::exit_fullscreen", reason = "Doesn't account for compatibility with Safari" },
{ path = "web_sys::Document::fullscreen_element", reason = "Doesn't account for compatibility with Safari" },
{ path = "icrate::AppKit::NSView::visibleRect", reason = "We expose a render target to the user, and visibility is not really relevant to that (and can break if you don't use the rectangle position as well). Use `frame` instead." },
]
3 changes: 0 additions & 3 deletions src/platform_impl/macos/appkit/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ extern_methods!(
// _mtm: MainThreadMarker,
) -> Option<Id<NSTextInputContext>>;

#[method(visibleRect)]
pub fn visibleRect(&self) -> NSRect;

#[method(hasMarkedText)]
pub fn hasMarkedText(&self) -> bool;

Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/macos/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ declare_class!(
self.removeTrackingRect(tracking_rect);
}

let rect = self.visibleRect();
let rect = self.frame();
let tracking_rect = self.add_tracking_rect(rect, false);
self.state.tracking_rect.set(Some(tracking_rect));
}
Expand All @@ -224,7 +224,7 @@ declare_class!(
self.removeTrackingRect(tracking_rect);
}

let rect = self.visibleRect();
let rect = self.frame();
let tracking_rect = self.add_tracking_rect(rect, false);
self.state.tracking_rect.set(Some(tracking_rect));

Expand Down

0 comments on commit a8a0462

Please sign in to comment.