From 41fc52b2943cbaa9e5e4ceec75f6cadd8c6e2c21 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 24 Nov 2024 02:07:23 +0100 Subject: [PATCH] #2440 maybe fixed? --- CHANGELOG.md | 1 + src/osax/common.h | 2 +- src/osax/payload.m | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b9e7c2a..387dcf22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/osax/common.h b/src/osax/common.h index 2794517f..dcecbe10 100644 --- a/src/osax/common.h +++ b/src/osax/common.h @@ -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 diff --git a/src/osax/payload.m b/src/osax/payload.m index 7d3f3fd9..05fdcadc 100644 --- a/src/osax/payload.m +++ b/src/osax/payload.m @@ -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() @@ -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