From 88bc42e01f12123d1f5babd712bc1027d9663d06 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 6 Dec 2020 23:23:46 +0100 Subject: [PATCH] #109 try to workaround weird resizing issues that occur for some applications --- CHANGELOG.md | 2 ++ src/application.c | 2 ++ src/application.h | 3 +++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5809806..f2672acb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ 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] +### Changed +- Try to workaround resizing issues in some applications due to weird undocumented accessibility properties [#109](https://github.com/koekeishiya/yabai/issues/109) ## [3.3.5] - 2020-12-03 ### Changed diff --git a/src/application.c b/src/application.c index 09958ab0..57f6e99e 100644 --- a/src/application.c +++ b/src/application.c @@ -135,6 +135,8 @@ struct application *application_create(struct process *process) struct application *application = malloc(sizeof(struct application)); memset(application, 0, sizeof(struct application)); application->ref = AXUIElementCreateApplication(process->pid); + AXUIElementSetAttributeValue(application->ref, kAXEnhancedUserInterface, kCFBooleanFalse); + AXUIElementSetAttributeValue(application->ref, kAXManualAccessibility, kCFBooleanTrue); application->psn = process->psn; application->pid = process->pid; application->name = process->name; diff --git a/src/application.h b/src/application.h index 01d258bf..2ead09af 100644 --- a/src/application.h +++ b/src/application.h @@ -1,6 +1,9 @@ #ifndef APPLICATION_H #define APPLICATION_H +const CFStringRef kAXEnhancedUserInterface = CFSTR("AXEnhancedUserInterface"); +const CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility"); + #define OBSERVER_CALLBACK(name) void name(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *context) typedef OBSERVER_CALLBACK(observer_callback);