Created
November 6, 2021 22:48
-
-
Save saagarjha/82dd0b4e4ff3ac5be4ea49d12fcfa204 to your computer and use it in GitHub Desktop.
Enable remote connections in Quartz Debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you haven't already, make sure to run this so the window list works: | |
// defaults write com.apple.QuartzDebug QuartzDebugPrivateInterface -bool YES | |
// https://gist.github.com/saagarjha/ed701e3369639410b5d5303612964557 | |
#import "swizzler.h" | |
#import <AppKit/AppKit.h> | |
static Swizzler<void, id<NSApplicationDelegate>, NSNotification *> QuartzDebug_applicationDidFinishLaunching_ { | |
NSClassFromString(@"QuartzDebug"), @selector(applicationDidFinishLaunching:), [](auto self, auto notification) { | |
QuartzDebug_applicationDidFinishLaunching_(self, notification); | |
auto menuItem = [NSApp.mainMenu insertItemWithTitle:@"" action:nil keyEquivalent:@"" atIndex:3]; | |
menuItem.submenu = [[NSMenu alloc] initWithTitle:@"Connect"]; | |
menuItem.submenu.itemArray = @[ | |
[[NSMenuItem alloc] initWithTitle:@"Server Mode" action:@selector(toggleServerMode:) keyEquivalent:@""], | |
[[NSMenuItem alloc] initWithTitle:@"Connect…" action:@selector(showConnectToServer:) keyEquivalent:@""], | |
[[NSMenuItem alloc] initWithTitle:@"Disconnect" action:@selector(disconnect:) keyEquivalent:@""], | |
]; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment