Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Dec 7, 2020
1 parent 306d7cc commit 9811ce2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/misc/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,12 @@ static inline bool ax_enhanced_userinterface(AXUIElementRef ref)
return result;
}

static inline void set_ax_enhanced_userinterface(AXUIElementRef ref, bool value)
{
if (value) {
AXUIElementSetAttributeValue(ref, kAXEnhancedUserInterface, kCFBooleanTrue);
} else {
AXUIElementSetAttributeValue(ref, kAXEnhancedUserInterface, kCFBooleanFalse);
}
}

#define AX_ENHANCED_UI_WORKAROUND(r, c) \
{\
bool eui = ax_enhanced_userinterface(r); \
if (eui) set_ax_enhanced_userinterface(r, false); \
if (eui) AXUIElementSetAttributeValue(r, kAXEnhancedUserInterface, kCFBooleanFalse); \
c \
if (eui) set_ax_enhanced_userinterface(r, true); \
if (eui) AXUIElementSetAttributeValue(r, kAXEnhancedUserInterface, kCFBooleanTrue); \
}

#pragma clang diagnostic push
Expand Down

0 comments on commit 9811ce2

Please sign in to comment.