Skip to content

Commit

Permalink
Try to make drawRect work on macOS
Browse files Browse the repository at this point in the history
This doesn't seem to work at all, so it seems like we'd have to use
DisplayLink.
  • Loading branch information
kchibisov committed Jun 22, 2023
1 parent f4777a4 commit 9091f46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/platform_impl/macos/appkit/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ extern_methods!(

#[sel(setHidden:)]
pub fn setHidden(&self, hidden: bool);

#[sel(setNeedsDisplayInRect:)]
pub fn setNeedsDisplayInRect(&self, rect: NSRect);
}
);

Expand Down
4 changes: 3 additions & 1 deletion src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ impl WinitWindow {
}

pub fn request_redraw(&self) {
AppState::queue_redraw(RootWindowId(self.id()));
// TODO figure out.
self.contentView().setNeedsDisplayInRect(self.frame());
// AppState::queue_redraw(RootWindowId(self.id()));
}

#[inline]
Expand Down

0 comments on commit 9091f46

Please sign in to comment.