Skip to content

Commit

Permalink
native/macos: comment on setNeedsDisplay hack
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed Jul 14, 2024
1 parent 611f727 commit 8936ebe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/native/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ unsafe fn view_base_decl(decl: &mut ClassDecl) {
}
}

// apparently, its impossible to use performSelectorOnMainThread
// with primitive type argument, so the only way to pass
// YES to setNeedsDisplay - send a no argument message
// https://stackoverflow.com/questions/6120614/passing-primitives-through-performselectoronmainthread
extern "C" fn set_needs_display_hack(this: &Object, _: Sel) {
unsafe {
msg_send_![this, setNeedsDisplay: YES];
Expand Down

0 comments on commit 8936ebe

Please sign in to comment.