Skip to content

Commit

Permalink
Added support for disabling fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasVerhoeven committed Jul 28, 2014
1 parent 3e0edb7 commit 4e45870
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 4 deletions.
Binary file not shown.
22 changes: 22 additions & 0 deletions AveNoAnimationsInMailPlugin/AveHookBootstrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,33 @@ +(void)swizzlePerformSendAnimation
method_exchangeImplementations(orig, repl);
}

#pragma mark - WindowTransformAnimation (Fullscreen animations)

-(NSTimeInterval)duration
{
return 0.0; // the animation should end immediately
}

+(void)aveSwizzleWindowTransformAnimation
{
// Swizzle Mail.app's -[WindowTransformAnimation duration] to be a very short animation, so
// the animation is not noticavle. this is for fullscreen window animations
Class class = NSClassFromString(@"WindowTransformAnimation");
Method orig = class_getInstanceMethod(class, @selector(duration));
Method repl = class_getInstanceMethod(self, @selector(duration));
NSLog(@"Ave: Swizzle addMethod [WindowTransformAnimation duration]: %p -> %p", orig, repl);

class_addMethod(class, @selector(duration), method_getImplementation(repl), method_getTypeEncoding(repl));
}

#pragma mark - bootstrap

+(void)load
{
NSLog(@"Ave: Loaded, time to start swizzling");
[self aveSwizzlePopoutAnimation];
[self swizzlePerformSendAnimation];
[self aveSwizzleWindowTransformAnimation];
}

#pragma mark MVMailBundle class methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2013 AveApps. All rights reserved.</string>
<string>Copyright © 2014 AveApps. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>AveHookBootstrapper</string>
<key>SupportedPluginCompatibilityUUIDs</key>
Expand Down
Binary file removed Output/.DS_Store
Binary file not shown.
Binary file modified Output/AveNoAnimationsInMailPlugin.mailbundle.zip
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand All @@ -37,7 +37,7 @@
<key>DTXcodeBuild</key>
<string>5B1008</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2013 AveApps. All rights reserved.</string>
<string>Copyright © 2014 AveApps. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>AveHookBootstrapper</string>
<key>SupportedPluginCompatibilityUUIDs</key>
Expand Down
Binary file not shown.

0 comments on commit 4e45870

Please sign in to comment.