Fix MusicVideo not showing non-first notifications on displays that don't have the menu bar on them.
authorPeter Hosey
Fri Jun 05 21:49:20 2009 -0700 (2009-06-05)
changeset 420810d1c49d4df1
parent 4207 62367bdaaf88
child 4209 f8a902d33769
Fix MusicVideo not showing non-first notifications on displays that don't have the menu bar on them.

The problem was that GrowlDisplayWindowController and GrowlPositionController were both trying to get the screen of a window that wasn't on a screen (yet|anymore), both before and after displaying the notification. The solution is to get the screen from the display window controller, not from the window.
Core/Source/GrowlPositionController.h
Core/Source/GrowlPositionController.m
Plugins/Displays/GrowlDisplayWindowController.m
     1.1 --- a/Core/Source/GrowlPositionController.h	Tue May 05 01:18:18 2009 -0700
     1.2 +++ b/Core/Source/GrowlPositionController.h	Fri Jun 05 21:49:20 2009 -0700
     1.3 @@ -87,6 +87,7 @@
     1.4   * @result YES or NO. If the result is NO, you should display your notification in a different rect/screen.
     1.5   */
     1.6  - (BOOL) reserveRect:(NSRect)inRect inScreen:(NSScreen *)inScreen forDisplayController:(GrowlDisplayWindowController *)displayController;
     1.7 +- (BOOL) reserveRect:(NSRect)inRect forDisplayController:(GrowlDisplayWindowController *)displayController;
     1.8  
     1.9  /*!
    1.10   * @method clearReservedRectForDisplayController
     2.1 --- a/Core/Source/GrowlPositionController.m	Tue May 05 01:18:18 2009 -0700
     2.2 +++ b/Core/Source/GrowlPositionController.m	Fri Jun 05 21:49:20 2009 -0700
     2.3 @@ -460,11 +460,14 @@
     2.4  	return result;
     2.5  }
     2.6  
     2.7 +- (BOOL) reserveRect:(NSRect)inRect forDisplayController:(GrowlDisplayWindowController *)displayController {
     2.8 +	return [self reserveRect:inRect inScreen:[displayController screen] forDisplayController:displayController];
     2.9 +}
    2.10  
    2.11  - (void) clearReservedRectForDisplayController:(GrowlDisplayWindowController *)displayController
    2.12  {
    2.13  	NSValue *controllerKey = [NSValue valueWithPointer:displayController];
    2.14 -	NSMutableSet *reservedRectsOfScreen = [self reservedRectsForScreen:[[displayController window] screen]];
    2.15 +	NSMutableSet *reservedRectsOfScreen = [self reservedRectsForScreen:[displayController screen]];
    2.16  	NSValue *value = [reservedRectsByController objectForKey:controllerKey];
    2.17  
    2.18  	if (value) {
     3.1 --- a/Plugins/Displays/GrowlDisplayWindowController.m	Tue May 05 01:18:18 2009 -0700
     3.2 +++ b/Plugins/Displays/GrowlDisplayWindowController.m	Fri Jun 05 21:49:20 2009 -0700
     3.3 @@ -149,7 +149,7 @@
     3.4  	if ([self respondsToSelector:@selector(idealOriginInRect:)])
     3.5  		foundSpace = [pc positionDisplay:self];
     3.6  	else
     3.7 -		foundSpace = (ignoresOtherNotifications || [pc reserveRect:[window frame] inScreen:[window screen] forDisplayController:self]);
     3.8 +		foundSpace = (ignoresOtherNotifications || [pc reserveRect:[window frame] forDisplayController:self]);
     3.9  
    3.10  	if (foundSpace) {
    3.11  		if (shouldStartDisplay) {