From 3002acc8954e30f22723eca104272ba87d2c44cc Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 2 Dec 2009 18:26:55 -0800 Subject: [PATCH 1/3] Change for the way in which we detect full bridge window close --- AppKit/CPWindow/CPWindow.j | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 62c0f7665..735cfa8b0 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1678,6 +1678,17 @@ CPTexturedBackgroundWindowMask if (!(_styleMask & CPClosableWindowMask)) return; + if ([self isFullBridge]) + { + var event = [CPApp currentEvent]; + + if ([event type] === CPKeyDown && [event characters] === "w" && ([event modifierFlags] & CPPlatformActionKeyMask)) + { + [[self platformWindow] _propagateCurrentDOMEvent:YES]; + return; + } + } + // Only send ONE windowShouldClose: message. if ([_delegate respondsToSelector:@selector(windowShouldClose:)]) { @@ -1738,9 +1749,6 @@ CPTexturedBackgroundWindowMask [[CPNotificationCenter defaultCenter] postNotificationName:CPWindowWillCloseNotification object:self]; [self orderOut:nil]; - - if ([self isFullBridge]) - [[self platformWindow] _propagateCurrentDOMEvent:YES]; } // Managing Main Status From 2120e9cf2a89c9a2ef89732a4ee79d012fde2b8f Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 2 Dec 2009 18:27:18 -0800 Subject: [PATCH 2/3] Potential fix for a drawing issue in IE. --- AppKit/CPWindow/_CPHUDWindowView.j | 2 +- .../CPWindow/HUD/CPWindowHUDBackground4.png | Bin 107 -> 118 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPWindow/_CPHUDWindowView.j b/AppKit/CPWindow/_CPHUDWindowView.j index 49a850fd0..ad0efd630 100644 --- a/AppKit/CPWindow/_CPHUDWindowView.j +++ b/AppKit/CPWindow/_CPHUDWindowView.j @@ -48,7 +48,7 @@ var HUD_TITLEBAR_HEIGHT = 26.0; [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground2.png"] size:CPSizeMake(6.0, 78.0)], [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground3.png"] size:CPSizeMake(6.0, 1.0)], - [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground4.png"] size:CPSizeMake(1.0, 1.0)], + [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground4.png"] size:CPSizeMake(5.0, 5.0)], [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground5.png"] size:CPSizeMake(6.0, 1.0)], [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/HUD/CPWindowHUDBackground6.png"] size:CPSizeMake(6.0, 6.0)], diff --git a/AppKit/Resources/CPWindow/HUD/CPWindowHUDBackground4.png b/AppKit/Resources/CPWindow/HUD/CPWindowHUDBackground4.png index 83d23053f1d9bf78a2bb7655bc533c82d16d79b7..4d450f53a76b047a87705e372f020e39f090d512 100644 GIT binary patch delta 85 zcmc~UQ|t`zbLZuf;$mQ6;Pv!y2?ElrAk4uABzyDKo=#NM(3S9XaSW-rm6Vc@P;sJx iZHB}K1};`cCLV@pYlhbz_8Im-wG5uFelF{r5}E)BC=>kv delta 74 zcmXTRR_qM$bLZuf;$mQ6;Pv!y2?ElLAk4uAB;`eqbWT*%P~!D;aSY**O-@KisNi5= Yc*gMP+|ub=fC?BqUHx3vIVCg!02OKxJOBUy From e6d86eaa9b5438035b356e365864dff17546468e Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 2 Dec 2009 19:19:18 -0800 Subject: [PATCH 3/3] Throw an exception for -1 indexes in CPArray objectAtIndex: --- Foundation/CPArray.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Foundation/CPArray.j b/Foundation/CPArray.j index 6f17532a9..66b6a266f 100755 --- a/Foundation/CPArray.j +++ b/Foundation/CPArray.j @@ -521,8 +521,8 @@ */ - (id)objectAtIndex:(int)anIndex { - if (anIndex >= length) - [CPException raise:CPRangeException reason:@"index (" + anIndex + @") beyond bounds (" + length + @")"]; + if (anIndex >= length || anIndex < 0) + [CPException raise:CPRangeException reason:@"index (" + anIndex + @") out of bounds (0 - " + length + @")"]; return self[anIndex]; }