Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View: add override to remove default macos keybinds from interfering #34

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions MACHAppDelegate_arm64_apple_macos12.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
.cfi_startproc
cbz x0, LBB0_2
stp x20, x19, [sp, #-32]!
stp x29, x30, [sp, #16]
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16]
.cfi_offset w30, -8
.cfi_offset w29, -16
.cfi_offset w19, -24
Expand All @@ -17,11 +17,15 @@
mov x0, x1
bl _objc_retainBlock
ldr x8, [x19, #8]
ldp x29, x30, [sp, #16]
mov x9, x0
str x0, [x19, #8]
mov x0, x8
str x9, [x19, #8]
ldp x29, x30, [sp, #16]
ldp x20, x19, [sp], #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
.cfi_restore w19
.cfi_restore w20
b _objc_release
LBB0_2:
ret
Expand All @@ -41,7 +45,7 @@ LBB1_2:
.p2align 2
"-[MACHAppDelegate applicationShouldTerminate:]":
.cfi_startproc
mov x0, xzr
mov x0, #0
ret
.cfi_endproc

Expand All @@ -56,7 +60,7 @@ LBB1_2:
"-[MACHAppDelegate .cxx_destruct]":
.cfi_startproc
add x0, x0, #8
mov x1, xzr
mov x1, #0
b _objc_storeStrong
.cfi_endproc

Expand Down
6 changes: 6 additions & 0 deletions MACHView.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ - (void)magnifyWithEvent:(NSEvent *)event {
_magnify_block(event);
}

// Add this method to prevent default macos keybind operations
// such as escape pulling the window out of fullscreen
- (void)doCommandBySelector:(SEL)selector
{
}

// This overrides the default initializer and creates a tracking area over the
// views visible rect
- (id)initWithFrame:(NSRect)frame {
Expand Down
Loading
Loading