Skip to content

Commit

Permalink
blind fix for OSX build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-L2L committed Aug 8, 2023
1 parent 454e8d8 commit 0f6fb64
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/qt/macdockiconhandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ bool dockClickHandler(id self,SEL _cmd,...) {
union_msgSendToGetClass.ptr = (void *)objc_msgSend;

void setupDockClickHandler() {
union {
id (*typed_msgSend)(id, SEL);
void *ptr;
} union_msgSend;
union_msgSend.ptr = (void *)objc_msgSend;

union {
Class (*typed_msgSendToGetClass)(id, SEL);
void *ptr;
} union_msgSendToGetClass;
union_msgSendToGetClass.ptr = (void *)objc_msgSend;

Class cls = objc_getClass("NSApplication");
id appInst = union_msgSend.typed_msgSend((id)cls, sel_registerName("sharedApplication"));

Expand Down

0 comments on commit 0f6fb64

Please sign in to comment.