Bug 676241 - Back out _drawTitleBar swizzling from UX (originally landed in bug 865374 and bug 868211) because it's no longer necessary.

This commit is contained in:
Markus Stange 2013-05-23 19:53:03 +02:00
parent d15e67fdb8
commit 55d5150bd3
2 changed files with 0 additions and 52 deletions

View File

@ -115,11 +115,6 @@ typedef struct _nsCocoaWindowList {
- (void)setBottomCornerRounded:(BOOL)rounded;
- (BOOL)bottomCornerRounded;
// Present since at least OS X 10.5. The OS calls this method on NSWindow
// (and its subclasses) to find out which NSFrameView subclass to instantiate
// to create its "frame view".
+ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask;
@end
@interface PopupWindow : BaseWindow

View File

@ -2485,55 +2485,8 @@ GetDPI(NSWindow* aWindow)
- (void)cursorUpdated:(NSEvent*)aEvent;
@end
@interface NSView(FrameViewMethodSwizzling)
- (void)FrameViewClass__drawTitleBar:(NSRect)aRect;
@end
@implementation NSView(FrameViewMethodSwizzling)
- (void)FrameViewClass__drawTitleBar:(NSRect)aRect
{
NSWindow* window = [self window];
if ([window isKindOfClass:[BaseWindow class]] &&
[(BaseWindow*)window drawsContentsIntoWindowFrame]) {
// Do not draw the title.
return;
}
[self FrameViewClass__drawTitleBar:aRect];
}
@end
static NSMutableSet *gSwizzledFrameViewClasses = nil;
@implementation BaseWindow
// The frame of a window is implemented using undocumented NSView subclasses.
// We disable window title drawing by overriding the _drawTitleBar: method on
// these frame view classes. The class which is used for a window is
// determined in the window's frameViewClassForStyleMask: method, so this is
// where we make sure that we have swizzled the method on all encountered
// classes.
+ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask
{
Class frameViewClass = [super frameViewClassForStyleMask:styleMask];
if (!gSwizzledFrameViewClasses) {
gSwizzledFrameViewClasses = [[NSMutableSet setWithCapacity:3] retain];
if (!gSwizzledFrameViewClasses) {
return frameViewClass;
}
}
if (![gSwizzledFrameViewClasses containsObject:frameViewClass]) {
nsToolkit::SwizzleMethods(frameViewClass, @selector(_drawTitleBar:),
@selector(FrameViewClass__drawTitleBar:));
[gSwizzledFrameViewClasses addObject:frameViewClass];
}
return frameViewClass;
}
- (id)initWithContentRect:(NSRect)aContentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)aBufferingType defer:(BOOL)aFlag
{
[super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];