зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 396559: Support window.blur(). r/sr=pink
This commit is contained in:
Родитель
4dd951b22d
Коммит
6b7022d62f
|
@ -185,6 +185,7 @@ typedef enum EBookmarkOpenBehavior
|
|||
- (BrowserWindowController*)mainWindowBrowserController;
|
||||
- (BrowserWindowController*)keyWindowBrowserController;
|
||||
- (NSWindow*)frontmostBrowserWindow;
|
||||
- (NSArray*)browserWindows;
|
||||
|
||||
- (BrowserWindowController*)openBrowserWindowWithURL:(NSString*)aURL andReferrer:(NSString*)aReferrer behind:(NSWindow*)window allowPopups:(BOOL)inAllowPopups;
|
||||
- (BrowserWindowController*)openBrowserWindowWithURLs:(NSArray*)urlArray behind:(NSWindow*)window allowPopups:(BOOL)inAllowPopups;
|
||||
|
|
|
@ -125,7 +125,6 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
- (void)showCertificatesNotification:(NSNotification*)inNotification;
|
||||
- (void)openPanelDidEnd:(NSOpenPanel*)inOpenPanel returnCode:(int)inReturnCode contextInfo:(void*)inContextInfo;
|
||||
- (void)loadApplicationPage:(NSString*)pageURL;
|
||||
- (NSArray*)browserWindows;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
|
||||
- (BOOL)makeFirstResponder:(NSResponder*) responder;
|
||||
|
||||
- (void)resignKeyAndOrderBack;
|
||||
|
||||
// mozWindow protocol
|
||||
- (BOOL)suppressMakeKeyFront;
|
||||
- (void)setSuppressMakeKeyFront:(BOOL)inSuppress;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
#import "BrowserWindow.h"
|
||||
#import "BrowserWindowController.h"
|
||||
#import "MainController.h"
|
||||
#import "AutoCompleteTextField.h"
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
|
||||
|
@ -71,6 +72,19 @@ static const int kEscapeKeyCode = 53;
|
|||
return madeFirstResponder;
|
||||
}
|
||||
|
||||
// The opposite of makeKeyAndOrderFront; used to support window.blur()
|
||||
- (void)resignKeyAndOrderBack
|
||||
{
|
||||
NSArray *browserWindows = [(MainController*)[NSApp delegate] browserWindows];
|
||||
if ([browserWindows count] > 1) {
|
||||
// If we are key we need to pass key status to the window that will become
|
||||
// frontmost, but if we aren't then don't mess with the key status.
|
||||
if ([self isKeyWindow])
|
||||
[(NSWindow*)[browserWindows objectAtIndex:1] makeKeyAndOrderFront:nil];
|
||||
[self orderWindow:NSWindowBelow relativeTo:[[browserWindows lastObject] windowNumber]];
|
||||
}
|
||||
}
|
||||
|
||||
// this gets called when the user hits the Escape key
|
||||
- (void)cancel:(id)sender
|
||||
{
|
||||
|
|
|
@ -297,6 +297,7 @@ typedef enum {
|
|||
-(BrowserTabViewItem*)createNewTabItem;
|
||||
|
||||
- (void)closeBrowserWindow:(BrowserWrapper*)inBrowser;
|
||||
- (void)sendBrowserWindowToBack:(BrowserWrapper*)inBrowser;
|
||||
|
||||
- (void)willShowPromptForBrowser:(BrowserWrapper*)inBrowser;
|
||||
- (void)didDismissPromptForBrowser:(BrowserWrapper*)inBrowser;
|
||||
|
|
|
@ -3388,6 +3388,11 @@ public:
|
|||
[[SessionManager sharedInstance] windowStateChanged];
|
||||
}
|
||||
|
||||
- (void)sendBrowserWindowToBack:(BrowserWrapper*)inBrowser
|
||||
{
|
||||
[(BrowserWindow*)[self window] resignKeyAndOrderBack];
|
||||
}
|
||||
|
||||
- (void)willShowPromptForBrowser:(BrowserWrapper*)inBrowser
|
||||
{
|
||||
// Remember where the user was, so we can come back.
|
||||
|
|
|
@ -262,6 +262,7 @@ class nsIArray;
|
|||
- (void)setTitle:(NSString *)title;
|
||||
- (void)sizeBrowserTo:(NSSize)dimensions;
|
||||
- (CHBrowserView*)createBrowserWindow:(unsigned int)mask;
|
||||
- (void)sendBrowserWindowToBack;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -917,6 +917,17 @@ enum StatusPriority {
|
|||
[[mWindow delegate] closeBrowserWindow:self];
|
||||
}
|
||||
|
||||
//
|
||||
// sendBrowserWindowToBack
|
||||
//
|
||||
// Send the window the back of the window stack, and unfocus it if it's the key
|
||||
// window.
|
||||
//
|
||||
- (void)sendBrowserWindowToBack
|
||||
{
|
||||
[[mWindow delegate] sendBrowserWindowToBack:self];
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// willShowPrompt
|
||||
|
|
|
@ -133,6 +133,9 @@ typedef enum {
|
|||
// behavior.
|
||||
- (void)closeBrowserWindow;
|
||||
|
||||
// Handle window.blur; send the window to the back and resign focus.
|
||||
- (void)sendBrowserWindowToBack;
|
||||
|
||||
// Called before and after a prompt is shown for the contained view
|
||||
- (void)willShowPrompt;
|
||||
- (void)didDismissPrompt;
|
||||
|
|
Загрузка…
Ссылка в новой задаче