Adium

Changeset 23103

Show
Ignore:
Timestamp:
04/07/2008 08:04:42 AM (8 months ago)
Author:
evands
Message:

-[AIWindowController stringWithSaveFrame] now generates its own string rather than relying on NSWindow's implementation, which performs some odd behavior when the window overlaps the dock and has a toolbar visible, moving it up by the height of the toolbar. Fixes #9096

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Adium Framework/Source/AIWindowController.m

    r23102 r23103  
    230230} 
    231231 
     232/*! 
     233 * @brief Return a string representation of the saved frame 
     234 * 
     235 * This is a fixed implementation of -[NSWindow stringWithSavedFrame].  The built-in stringWithSavedFrame method 
     236 * performs some odd behavior when the window overlaps the dock and has a toolbar visible, moving it up by the height 
     237 * of the toolbar. 
     238 */ 
    232239- (NSString *)stringWithSavedFrame 
    233240{ 
    234         return [[self window] stringWithSavedFrame]; 
     241        NSRect frame = [[self window] frame]; 
     242        NSRect screenFrame = [[[self window] screen] frame]; 
     243 
     244        return [NSString stringWithFormat:@"%.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f", 
     245                        NSMinX(frame), NSMinY(frame), NSWidth(frame), NSHeight(frame), 
     246                        NSMinX(screenFrame), NSMinY(screenFrame), NSWidth(screenFrame), NSHeight(screenFrame)];  
    235247} 
    236248