Skip to content

Commit

Permalink
Revert "fix(macos): global keys shortcuts" (#1163)
Browse files Browse the repository at this point in the history
* Revert "fix(macos): global keys shortcuts (#1156)"

This reverts commit c033bd2.

* chore: add changlog file
  • Loading branch information
pewsheen authored Feb 8, 2024
1 parent 8f92a35 commit e2542de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changes/revert-global-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Revert global keys shortcuts (wry#1156)
14 changes: 0 additions & 14 deletions src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ impl InnerWebView {
sel!(acceptsFirstMouse:),
accept_first_mouse as extern "C" fn(&Object, Sel, id) -> BOOL,
);
decl.add_method(
sel!(performKeyEquivalent:),
key_equivalent as extern "C" fn(&mut Object, Sel, id) -> BOOL,
);

extern "C" fn accept_first_mouse(this: &Object, _sel: Sel, _event: id) -> BOOL {
unsafe {
Expand All @@ -357,17 +353,7 @@ impl InnerWebView {
}
}
}

extern "C" fn key_equivalent(_this: &mut Object, _sel: Sel, event: id) -> BOOL {
unsafe {
let app = cocoa::appkit::NSApp();
let menu: id = msg_send![app, mainMenu];
let () = msg_send![menu, performKeyEquivalent: event];
}
YES
}
}

decl.register()
}
_ => class!(WryWebView),
Expand Down

0 comments on commit e2542de

Please sign in to comment.