mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Implement activate and deactivate events for chimera (bug 157648). r=sfraser.
This commit is contained in:
parent
f84fcb05fc
commit
ffb06f8e7f
@ -6,4 +6,6 @@
|
|||||||
{
|
{
|
||||||
IBOutlet id mAutoCompleteTextField;
|
IBOutlet id mAutoCompleteTextField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL) makeFirstResponder:(NSResponder*) responder;
|
||||||
@end
|
@end
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import "BrowserWindow.h"
|
#import "BrowserWindow.h"
|
||||||
#import "CHAutoCompleteTextField.h"
|
#import "CHAutoCompleteTextField.h"
|
||||||
|
#import "BrowserWindowController.h"
|
||||||
|
|
||||||
static const int kEscapeKeyCode = 53;
|
static const int kEscapeKeyCode = 53;
|
||||||
|
|
||||||
@ -19,4 +20,13 @@ static const int kEscapeKeyCode = 53;
|
|||||||
[super sendEvent:theEvent];
|
[super sendEvent:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)makeFirstResponder:(NSResponder*)responder
|
||||||
|
{
|
||||||
|
NSResponder* oldResponder = [self firstResponder];
|
||||||
|
BOOL madeFirstResponder = [super makeFirstResponder:responder];
|
||||||
|
if (madeFirstResponder && oldResponder != [self firstResponder])
|
||||||
|
[(BrowserWindowController*)[self delegate] focusChangedFrom:oldResponder to:[self firstResponder]];
|
||||||
|
return madeFirstResponder;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -248,6 +248,12 @@ class nsIDOMNode;
|
|||||||
|
|
||||||
- (CHBookmarksToolbar*) bookmarksToolbar;
|
- (CHBookmarksToolbar*) bookmarksToolbar;
|
||||||
|
|
||||||
|
- (BOOL) isResponderGeckoView:(NSResponder*) responder;
|
||||||
|
|
||||||
|
// called when the internal window focus has changed
|
||||||
|
// this allows us to dispatch activate and deactivate events as necessary
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder;
|
||||||
|
|
||||||
// Called to get cached versions of our security icons
|
// Called to get cached versions of our security icons
|
||||||
+ (NSImage*) insecureIcon;
|
+ (NSImage*) insecureIcon;
|
||||||
+ (NSImage*) secureIcon;
|
+ (NSImage*) secureIcon;
|
||||||
|
@ -100,6 +100,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
mModalSession = nil;
|
mModalSession = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isResponderGeckoView:(NSResponder*) responder
|
||||||
|
{
|
||||||
|
return ([responder isKindOfClass:[NSView class]] &&
|
||||||
|
[(NSView*)responder isDescendantOf:[mBrowserView getBrowserView]]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
||||||
@ -107,6 +113,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// on whether we have multiple tabs
|
// on whether we have multiple tabs
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey:(NSNotification *)notification
|
- (void)windowDidResignKey:(NSNotification *)notification
|
||||||
@ -115,6 +127,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// to Command-W, for other windows.
|
// to Command-W, for other windows.
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification *)notification
|
- (void)windowDidBecomeMain:(NSNotification *)notification
|
||||||
@ -1403,6 +1421,15 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
return sBrokenIcon;
|
return sBrokenIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder
|
||||||
|
{
|
||||||
|
BOOL oldResponderIsGecko = [self isResponderGeckoView:oldResponder];
|
||||||
|
BOOL newResponderIsGecko = [self isResponderGeckoView:newResponder];
|
||||||
|
|
||||||
|
if (oldResponderIsGecko != newResponderIsGecko)
|
||||||
|
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,4 +6,6 @@
|
|||||||
{
|
{
|
||||||
IBOutlet id mAutoCompleteTextField;
|
IBOutlet id mAutoCompleteTextField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL) makeFirstResponder:(NSResponder*) responder;
|
||||||
@end
|
@end
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import "BrowserWindow.h"
|
#import "BrowserWindow.h"
|
||||||
#import "CHAutoCompleteTextField.h"
|
#import "CHAutoCompleteTextField.h"
|
||||||
|
#import "BrowserWindowController.h"
|
||||||
|
|
||||||
static const int kEscapeKeyCode = 53;
|
static const int kEscapeKeyCode = 53;
|
||||||
|
|
||||||
@ -19,4 +20,13 @@ static const int kEscapeKeyCode = 53;
|
|||||||
[super sendEvent:theEvent];
|
[super sendEvent:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)makeFirstResponder:(NSResponder*)responder
|
||||||
|
{
|
||||||
|
NSResponder* oldResponder = [self firstResponder];
|
||||||
|
BOOL madeFirstResponder = [super makeFirstResponder:responder];
|
||||||
|
if (madeFirstResponder && oldResponder != [self firstResponder])
|
||||||
|
[(BrowserWindowController*)[self delegate] focusChangedFrom:oldResponder to:[self firstResponder]];
|
||||||
|
return madeFirstResponder;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -248,6 +248,12 @@ class nsIDOMNode;
|
|||||||
|
|
||||||
- (CHBookmarksToolbar*) bookmarksToolbar;
|
- (CHBookmarksToolbar*) bookmarksToolbar;
|
||||||
|
|
||||||
|
- (BOOL) isResponderGeckoView:(NSResponder*) responder;
|
||||||
|
|
||||||
|
// called when the internal window focus has changed
|
||||||
|
// this allows us to dispatch activate and deactivate events as necessary
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder;
|
||||||
|
|
||||||
// Called to get cached versions of our security icons
|
// Called to get cached versions of our security icons
|
||||||
+ (NSImage*) insecureIcon;
|
+ (NSImage*) insecureIcon;
|
||||||
+ (NSImage*) secureIcon;
|
+ (NSImage*) secureIcon;
|
||||||
|
@ -100,6 +100,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
mModalSession = nil;
|
mModalSession = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isResponderGeckoView:(NSResponder*) responder
|
||||||
|
{
|
||||||
|
return ([responder isKindOfClass:[NSView class]] &&
|
||||||
|
[(NSView*)responder isDescendantOf:[mBrowserView getBrowserView]]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
||||||
@ -107,6 +113,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// on whether we have multiple tabs
|
// on whether we have multiple tabs
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey:(NSNotification *)notification
|
- (void)windowDidResignKey:(NSNotification *)notification
|
||||||
@ -115,6 +127,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// to Command-W, for other windows.
|
// to Command-W, for other windows.
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification *)notification
|
- (void)windowDidBecomeMain:(NSNotification *)notification
|
||||||
@ -1403,6 +1421,15 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
return sBrokenIcon;
|
return sBrokenIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder
|
||||||
|
{
|
||||||
|
BOOL oldResponderIsGecko = [self isResponderGeckoView:oldResponder];
|
||||||
|
BOOL newResponderIsGecko = [self isResponderGeckoView:newResponder];
|
||||||
|
|
||||||
|
if (oldResponderIsGecko != newResponderIsGecko)
|
||||||
|
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,4 +6,6 @@
|
|||||||
{
|
{
|
||||||
IBOutlet id mAutoCompleteTextField;
|
IBOutlet id mAutoCompleteTextField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL) makeFirstResponder:(NSResponder*) responder;
|
||||||
@end
|
@end
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import "BrowserWindow.h"
|
#import "BrowserWindow.h"
|
||||||
#import "CHAutoCompleteTextField.h"
|
#import "CHAutoCompleteTextField.h"
|
||||||
|
#import "BrowserWindowController.h"
|
||||||
|
|
||||||
static const int kEscapeKeyCode = 53;
|
static const int kEscapeKeyCode = 53;
|
||||||
|
|
||||||
@ -19,4 +20,13 @@ static const int kEscapeKeyCode = 53;
|
|||||||
[super sendEvent:theEvent];
|
[super sendEvent:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)makeFirstResponder:(NSResponder*)responder
|
||||||
|
{
|
||||||
|
NSResponder* oldResponder = [self firstResponder];
|
||||||
|
BOOL madeFirstResponder = [super makeFirstResponder:responder];
|
||||||
|
if (madeFirstResponder && oldResponder != [self firstResponder])
|
||||||
|
[(BrowserWindowController*)[self delegate] focusChangedFrom:oldResponder to:[self firstResponder]];
|
||||||
|
return madeFirstResponder;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -248,6 +248,12 @@ class nsIDOMNode;
|
|||||||
|
|
||||||
- (CHBookmarksToolbar*) bookmarksToolbar;
|
- (CHBookmarksToolbar*) bookmarksToolbar;
|
||||||
|
|
||||||
|
- (BOOL) isResponderGeckoView:(NSResponder*) responder;
|
||||||
|
|
||||||
|
// called when the internal window focus has changed
|
||||||
|
// this allows us to dispatch activate and deactivate events as necessary
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder;
|
||||||
|
|
||||||
// Called to get cached versions of our security icons
|
// Called to get cached versions of our security icons
|
||||||
+ (NSImage*) insecureIcon;
|
+ (NSImage*) insecureIcon;
|
||||||
+ (NSImage*) secureIcon;
|
+ (NSImage*) secureIcon;
|
||||||
|
@ -100,6 +100,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
mModalSession = nil;
|
mModalSession = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isResponderGeckoView:(NSResponder*) responder
|
||||||
|
{
|
||||||
|
return ([responder isKindOfClass:[NSView class]] &&
|
||||||
|
[(NSView*)responder isDescendantOf:[mBrowserView getBrowserView]]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
||||||
@ -107,6 +113,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// on whether we have multiple tabs
|
// on whether we have multiple tabs
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey:(NSNotification *)notification
|
- (void)windowDidResignKey:(NSNotification *)notification
|
||||||
@ -115,6 +127,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// to Command-W, for other windows.
|
// to Command-W, for other windows.
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification *)notification
|
- (void)windowDidBecomeMain:(NSNotification *)notification
|
||||||
@ -1403,6 +1421,15 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
return sBrokenIcon;
|
return sBrokenIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder
|
||||||
|
{
|
||||||
|
BOOL oldResponderIsGecko = [self isResponderGeckoView:oldResponder];
|
||||||
|
BOOL newResponderIsGecko = [self isResponderGeckoView:newResponder];
|
||||||
|
|
||||||
|
if (oldResponderIsGecko != newResponderIsGecko)
|
||||||
|
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,4 +6,6 @@
|
|||||||
{
|
{
|
||||||
IBOutlet id mAutoCompleteTextField;
|
IBOutlet id mAutoCompleteTextField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL) makeFirstResponder:(NSResponder*) responder;
|
||||||
@end
|
@end
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import "BrowserWindow.h"
|
#import "BrowserWindow.h"
|
||||||
#import "CHAutoCompleteTextField.h"
|
#import "CHAutoCompleteTextField.h"
|
||||||
|
#import "BrowserWindowController.h"
|
||||||
|
|
||||||
static const int kEscapeKeyCode = 53;
|
static const int kEscapeKeyCode = 53;
|
||||||
|
|
||||||
@ -19,4 +20,13 @@ static const int kEscapeKeyCode = 53;
|
|||||||
[super sendEvent:theEvent];
|
[super sendEvent:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)makeFirstResponder:(NSResponder*)responder
|
||||||
|
{
|
||||||
|
NSResponder* oldResponder = [self firstResponder];
|
||||||
|
BOOL madeFirstResponder = [super makeFirstResponder:responder];
|
||||||
|
if (madeFirstResponder && oldResponder != [self firstResponder])
|
||||||
|
[(BrowserWindowController*)[self delegate] focusChangedFrom:oldResponder to:[self firstResponder]];
|
||||||
|
return madeFirstResponder;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -248,6 +248,12 @@ class nsIDOMNode;
|
|||||||
|
|
||||||
- (CHBookmarksToolbar*) bookmarksToolbar;
|
- (CHBookmarksToolbar*) bookmarksToolbar;
|
||||||
|
|
||||||
|
- (BOOL) isResponderGeckoView:(NSResponder*) responder;
|
||||||
|
|
||||||
|
// called when the internal window focus has changed
|
||||||
|
// this allows us to dispatch activate and deactivate events as necessary
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder;
|
||||||
|
|
||||||
// Called to get cached versions of our security icons
|
// Called to get cached versions of our security icons
|
||||||
+ (NSImage*) insecureIcon;
|
+ (NSImage*) insecureIcon;
|
||||||
+ (NSImage*) secureIcon;
|
+ (NSImage*) secureIcon;
|
||||||
|
@ -100,6 +100,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
mModalSession = nil;
|
mModalSession = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isResponderGeckoView:(NSResponder*) responder
|
||||||
|
{
|
||||||
|
return ([responder isKindOfClass:[NSView class]] &&
|
||||||
|
[(NSView*)responder isDescendantOf:[mBrowserView getBrowserView]]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
BOOL windowWithMultipleTabs = ([mTabBrowser numberOfTabViewItems] > 1);
|
||||||
@ -107,6 +113,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// on whether we have multiple tabs
|
// on whether we have multiple tabs
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey:(NSNotification *)notification
|
- (void)windowDidResignKey:(NSNotification *)notification
|
||||||
@ -115,6 +127,12 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
// to Command-W, for other windows.
|
// to Command-W, for other windows.
|
||||||
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseTabMenuItemKeyEquivalent:NO];
|
||||||
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
[[NSApp delegate] adjustCloseWindowMenuItemKeyEquivalent:NO];
|
||||||
|
|
||||||
|
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||||
|
CHBrowserView* browserView = [mBrowserView getBrowserView];
|
||||||
|
if (browserView)
|
||||||
|
[browserView setActive:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification *)notification
|
- (void)windowDidBecomeMain:(NSNotification *)notification
|
||||||
@ -1403,6 +1421,15 @@ static NSArray* sToolbarDefaults = nil;
|
|||||||
return sBrokenIcon;
|
return sBrokenIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) focusChangedFrom:(NSResponder*) oldResponder to:(NSResponder*) newResponder
|
||||||
|
{
|
||||||
|
BOOL oldResponderIsGecko = [self isResponderGeckoView:oldResponder];
|
||||||
|
BOOL newResponderIsGecko = [self isResponderGeckoView:newResponder];
|
||||||
|
|
||||||
|
if (oldResponderIsGecko != newResponderIsGecko)
|
||||||
|
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user