Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Created September 11, 2026 20:22
Show Gist options
  • Select an option

  • Save saagarjha/cc5cf7a1082c296b2cc8308ee06f7436 to your computer and use it in GitHub Desktop.

Select an option

Save saagarjha/cc5cf7a1082c296b2cc8308ee06f7436 to your computer and use it in GitHub Desktop.
Restore Safari titles in Exposé on macOS Golden Gate
// https://gist.github.com/saagarjha/ed701e3369639410b5d5303612964557
#import "swizzler.h"
#import <AppKit/AppKit.h>
#import <objc/runtime.h>
static Swizzler<void, NSWindow *> BrowserWindow_updateCGSWindowTitle {
NSClassFromString(@"BrowserWindow"), @selector(updateCGSWindowTitle), [](auto self) {
BrowserWindow_updateCGSWindowTitle(self);
auto auxiliaryStorage = object_getIvar(self, class_getInstanceVariable(self.class, "_auxiliaryStorage"));
auto wmWindow = object_getIvar(auxiliaryStorage, class_getInstanceVariable([auxiliaryStorage class], "_wmWindow"));
[wmWindow setTitle:self.title];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment