Skip to content

Commit

Permalink
#2440 maybe fixed?
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Nov 24, 2024
1 parent 745e9c2 commit 41fc52b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Maybe fix issue with patching macOS space switching animation on macOS 14.7 Intel x86-64 [#2440](https://github.com/koekeishiya/yabai/issues/2440)

## [7.1.5] - 2024-11-01
### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/osax/common.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SA_COMMON_H
#define SA_COMMON_H

#define OSAX_VERSION "2.1.18"
#define OSAX_VERSION "2.1.19"

#define OSAX_ATTRIB_DOCK_SPACES 0x01
#define OSAX_ATTRIB_DPPM 0x02
Expand Down
10 changes: 8 additions & 2 deletions src/osax/payload.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static bool verify_os_version(NSOperatingSystemVersion os_version)
}

#ifdef __x86_64__
static double animation_time = 0.0001;
static double *animation_time;
#endif

static void init_instances()
Expand Down Expand Up @@ -377,7 +377,13 @@ static void init_instances()
NSLog(@"[yabai-sa] (0x%llx) animation_time_addr found at address 0x%llX (0x%llx)", baseaddr, animation_time_addr, animation_time_addr - baseaddr);
if (vm_protect(mach_task_self(), page_align(animation_time_addr), vm_page_size, 0, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY) == KERN_SUCCESS) {
#ifdef __x86_64__
*(uint32_t *)(animation_time_addr + 4) = (uint32_t)((uint64_t)&animation_time - (animation_time_addr + 8));
animation_time = malloc(sizeof(double));
if (animation_time) {
*animation_time = 0.0001;
*(uint32_t *)(animation_time_addr + 4) = (uint32_t)((uint64_t)animation_time - (animation_time_addr + 8));
} else {
NSLog(@"[yabai-sa] unable to allocate memory for animation_time; unable to patch instruction!");
}
#elif __arm64__
*(uint32_t *) animation_time_addr = 0x2f00e400;
#endif
Expand Down

0 comments on commit 41fc52b

Please sign in to comment.